> ...
>> Traceback (most recent call last):
>>   File "build/bdist.linux-x86_64/egg/trac/loader.py", line 68, in
>> _load_eggs
>>     entry.load(require=True)
>>   File "build/bdist.linux-i686/egg/pkg_resources.py", line 1954, in load
>>     entry = __import__(self.module_name, globals(),globals(), ['__name__'])
>> ImportError: No module named SampleQueryPreprocessor
>>
>
> Launch the Python interpreter and import that module i.e.
> SampleQueryPreprocessor . Perhaps you'll notice any failure ?

Like a syntax error in my plugin source?  Maybe but this really feels
like a namespace problem.

>...
>> What should it be?  Better yet, where can I find a tutorial or
>> reference so I can get this right next time.  This is making me
>> insane!
>
> This might not be related to Trac ...

My wife might agree. ;-)


Trying this methodically with code that is presumably known good, I go
to http://trac.edgewall.org/wiki/TracDev/PluginDevelopment for an
example.  In my Trac 1.0 development area I create
trac/sample-plugins/test. In that directory I create helloworld.py and
setup.py with the code from the page mentioned above.  Then I do:

  python setup.py bdist_egg
  sudo cp dist/*.egg /opt/trac/trac1.0/plugins

and restart tracd.  The log shows:

------------------------
2013-01-22 08:17:52,805 Trac[loader] DEBUG: Adding plugin
TracHelloWorld 1.0 from
/opt/trac/trac1.0/plugins/TracHelloWorld-1.0-py2.7.egg
2013-01-22 08:17:52,819 Trac[loader] DEBUG: Loading helloworld from
/opt/trac/trac1.0/plugins/TracHelloWorld-1.0-py2.7.egg
2013-01-22 08:17:52,823 Trac[loader] ERROR: Skipping "helloworld =
myplugs.helloworld":
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/loader.py", line 68, in _load_eggs
    entry.load(require=True)
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 1954, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named myplugs.helloworld
------------------------

so, I move helloworld.py to trac/sample-plugins/test/myplugs and
repeat.  This time I see:

------------------------
2013-01-22 08:17:52,805 Trac[loader] DEBUG: Adding plugin
TracHelloWorld 1.0 from
/opt/trac/trac1.0/plugins/TracHelloWorld-1.0-py2.7.egg
2013-01-22 08:17:52,819 Trac[loader] DEBUG: Loading helloworld from
/opt/trac/trac1.0/plugins/TracHelloWorld-1.0-py2.7.egg
2013-01-22 08:17:52,823 Trac[loader] ERROR: Skipping "helloworld =
myplugs.helloworld":
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/loader.py", line 68, in _load_eggs
    entry.load(require=True)
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 1954, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named myplugs.helloworld
------------------------

Where should the files from the example be placed so that the example works?

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to trac-dev@googlegroups.com.
To unsubscribe from this group, send email to 
trac-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to