> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of lidiri
> Sent: Wednesday, July 16, 2008 2:43 AM
> To: Trac Development
> Subject: [Trac-dev] Trac plugin and module import
> 
> 
> Hi all,
> 
> I try to create a plugin for trac.
> But i have a problem for refactor my code.
> Here my code that work :
> 
> myplugin/__init__.py
> myplugin/Bar.py
> myplugin/main.py
> 
> and i try to reffactor like this (moving Bar module in foo
> directory) :
> 
> myplugin/__init__.py ( from myplugin import * )
> myplugin/main.py
>     this file have a line :
>     from myplugin.foo.Bar import BarTest
> 
> myplugin/foo/__init__.py (empty file)
> myplugin/foo/Bar.py
>     this file have a class BarTest
>     class BarTest:
>         pass
> 
> when i reload trac i have the error message :
> Skipping "myplugin.main = myplugin.main": (can't import "No module
> named foo.Bar")
> 
> In these two case i have the file setup.py:
> entry_points={'trac.plugins':
>                     [
>                      'myplugin=myplugin',
>                      'myplugin.main=myplugin.main',
>                     ]
> 
> If someone have an idea on this problem ?

Did you set packages = ['myplugin', 'myplugin.foo']

You might just want to use find_packages() to simplify this.

--Noah


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

Reply via email to