single file plugin - can't import TagEngine from tractags.api

11 views
Skip to first unread message

Ittay Dror

unread,
Dec 12, 2006, 3:03:55 AM12/12/06
to Trac Users
Hi,

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

Noah Kantrowitz

unread,
Dec 12, 2006, 3:35:29 AM12/12/06
to trac-...@googlegroups.com
On Dec 12, 2006, at 3:03 AM, Ittay Dror wrote:

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

Ittay Dror

unread,
Dec 12, 2006, 4:09:37 AM12/12/06
to trac-...@googlegroups.com
you get $10

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

Ilias Lazaridis

unread,
Dec 12, 2006, 6:34:10 AM12/12/06
to Trac Users
Ο/Η Ittay Dror έγραψε:

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

.

--
http://dev.lazaridis.com/base

Reply all
Reply to author
Forward
0 new messages