I'm trying to write a singe file plugin. I have:
from tractags.api import TagEngine
which fails:
2006-12-12 10:02:51,613 Trac[loader] ERROR: Failed to load plugin from
/home/ittayd/qrm/trac/plugins/TaggedTickets.py
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/trac/loader.py", line 52, in
load_components
module = imp.load_source(plugin_name, plugin_file)
File "/home/ittayd/qrm/trac/plugins/TaggedTickets.py", line 5, in ?
from tractags.api import TagEngine
ImportError: No module named tractags.api
>
> Hi,
>
> I'm trying to write a singe file plugin. I have:
> from tractags.api import TagEngine
$10 says this is a load-ordering issue. If your plugin gets loaded
before Tags (and I think all single-file plugins are loaded before
the eggs) then it isn't available for import. You will have to make a
"real" plugin and give install_requires=['TracTags'].
--Noah
i solved this by moving the import into the render function
--
===================================
Ittay Dror,
Chief architect, openQRM group leader,
R&D, Qlusters Inc.
itt...@qlusters.com
+972-3-6081994 Fax: +972-3-6081841
www.openqrm.org - Data Center Provisioning
Your usage is correct, but there is a 'logical defect' of the
trac-plugin-loader. I've filed an Issue:
http://trac.edgewall.org/ticket/4383
The loader, a central part of the trac-framework, has essentially a
draft-status, see:
http://trac.edgewall.org/ticket/4317
.