Edgewall Software

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11420 closed defect (fixed)

HelloWorld sample plugin fails to load after failing to import cleandoc_ — at Version 4

Reported by: mjs@… Owned by: Ryan J Ollos
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 cleandoc_ in HelloWorld sample macro.

API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

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.

Change History (4)

comment:1 by Ryan J Ollos, 10 years ago

Description: modified (diff)

comment:2 by Ryan J Ollos, 10 years ago

It looks like an issue with your Python search path. You should put HelloWorld.py in your environment plugins directory, or in a Python site-packages directory.

comment:3 by Ryan J Ollos, 10 years ago

Milestone: 1.0.2
Owner: set to Ryan J Ollos
Status: newassigned

Oh, but there is no import of cleandoc_.

… as you mentioned! Sorry for not reading more carefully.

Last edited 10 years ago by Ryan J Ollos (previous) (diff)

comment:4 by Ryan J Ollos, 10 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 1.0-stable in [12388] and merged to trunk in [12389].

Note: See TracTickets for help on using tickets.