On Oct 28, 7:32 pm, osimons <[EMAIL PROTECTED]> wrote: > > > > I'm quite sure they are instantiated as intended and get .config, .log > > > and .env attached. Could you provide specific code that do not work as > > > intended? > > > Easily. It will be duplicated from another thread here, but I guess it > > is ok. > > Extension > > point:http://trac.edgewall.org/attachment/ticket/781/icachechangesetlistene... > > > Plugin that uses extension point (and doesn't get env > > attributes):http://python.pastebin.com/d2f6044ae
The post is deleted, so I've readded it: http://python.pastebin.com/ff8dd90e > > Exception message from trac.log: > > File "/home/.december/trex/fartrac/plugins/mantis_tickets_query.py", > > line 50, in edit_changeset > > self.log.info("Lookup bug title at Mantis webpage %s" % url) > > AttributeError: 'MantisChangesetQuery' object has no attribute 'log' > > Ah. Well, the word you use - and the word I use - is 'instantiated', > and env + log + config gets added upon instantiation of a plugin/ > component (and don't exist in definitions). That example paste has no > env and you're trying to use it directly from class definition. > > If your __main__ / global also had this it would likely work: > > from trac.env import Environment > env = Environment('/path/to/a/trac/project') > r = MantisChangesetQuery(env).mantis_re > m = r.findall(doc) > print m Do not pay attention in __main__ - the plugin is placed into corresponding environment directory and is loaded by Trac, but doesn't get the properties like other plugins without trac.env imports that I have implementing IWikiSyntaxProvider interface. 80% that the problem is related to the instantiation of CacheManager component without environment and ComponentMeta registry. I am investigating the details right now. -- WBR, anatoli --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en -~----------~----~----~----~------~----~------~--~---
