Edgewall Software
Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11420 closed defect (fixed)

HelloWorld sample plugin fails to load after failing to import cleandoc_

Reported by: mjs@… Owned by: mjs@…
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.

Attachments (0)

Change History (5)

comment:1 by Ryan J Ollos, 11 years ago

Description: modified (diff)

comment:2 by Ryan J Ollos, 11 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, 11 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 11 years ago by Ryan J Ollos (previous) (diff)

comment:4 by Ryan J Ollos, 11 years ago

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

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

comment:5 by Ryan J Ollos, 11 years ago

Owner: changed from Ryan J Ollos to mjs@…

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain mjs@….
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from mjs@… to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.