Modify ↓
#11420 closed defect (fixed)
HelloWorld sample plugin fails to load after failing to import cleandoc_
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | general | Version: | 1.0.1 |
Severity: | normal | Keywords: | HelloWorld plugin cleandoc_ |
Cc: | Branch: | ||
Release Notes: |
Added missing import of |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Error logs are filled with the following:
2013-12-29 22:20:30,315 Trac[loader] ERROR: Failed to load plugin from /etc/tra\ c/plugins.d/!HelloWorld.py: Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/trac/loader.py", line 90, in _load_py_\ files module = imp.load_source(plugin_name, plugin_file) File "/etc/trac/plugins.d/HelloWorld.py", line 39, in <module> class !HelloWorldMacro(!WikiMacroBase): File "/etc/trac/plugins.d/HelloWorld.py", line 40, in !HelloWorldMacro _description = cleandoc_( !NameError: name 'cleandoc_' is not defined
The problem seems to be solved by including
from trac.util.translation import cleandoc_
in HelloWorld.py.
Attachments (0)
Change History (5)
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:2 by , 11 years ago
comment:3 by , 11 years ago
Milestone: | → 1.0.2 |
---|---|
Owner: | set to |
Status: | new → assigned |
Oh, but there is no import of cleandoc_
.
… as you mentioned! Sorry for not reading more carefully.
comment:4 by , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:5 by , 11 years ago
Owner: | changed from | to
---|
Note:
See TracTickets
for help on using tickets.
It looks like an issue with your Python search path. You should put
HelloWorld.py
in your environment plugins directory, or in a Pythonsite-packages
directory.