On Oct 28, 3:53 pm, anatoly techtonik <[EMAIL PROTECTED]> wrote:
> On Oct 28, 3:51 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
>
> 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


:::simon

https://www.coderesort.com

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to