On 17:05 Sun 18 Jan     , Guillaume Desmottes wrote:
> Le dimanche 18 janvier 2009 à 12:38 +0000, Guillaume Desmottes a écrit :
> > Le lundi 12 janvier 2009 à 11:51 +0100, Olivier Tilloy a écrit :
> > > > - I use pyamf to query the remote server. IIRC, the policy about
> > > > external dep is to ship them with the plugin bundle. Is that still true?
> > > > If it is, do you have any doc explaining how to do it?
> > > 
> > > Still true. There is no documentation on how to do this but for small
> > > dependencies it should be fairly easy. You can have a look at how it's
> > > done in the weather plugin with pymetar
> > > (http://bazaar.launchpad.net/~osomon/elisa-plugin-weather/weather/revision/18)
> > 
> > 
> > Dependency is not that trivial. Is it possible to just ship PyAMF egg
> > (as the one created using "easy_install pyamf" instead of the whole
> > source tree?
> 
> Finally I managed to import the dependency but I had to do this ugly
> hack:
> http://bazaar.launchpad.net/~cassidy/elisa-plugin-rtbf/trunk/revision/30
> 
> Is that ok?
I've heard it's unwise to use .__file__. You should rather use stuff
like pkg_resources.resource_filename() I guess. Though I am not sure to
understand the context around your code. Is pyamf in the egg of your
plugin? Is it in another egg? If it's in the same egg, and the egg is
built correctly, it should be possible to do the "import pyamf" without
doing anything. That would require putting the pyamf directory at the root
of your egg, and might conflict with other plugins (as well as your
present solutoin), else, you might be able to import it as
elisa.plugins.rtbf.extern.pyamf, not sure this works, but it looks to me
like the safest solution.
> 
>       G.
G.

Reply via email to