Le dimanche 18 janvier 2009 à 21:37 +0100, guijemont - Guillaume Emont a écrit : > 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.
I changed my code to use it, thanks. http://bazaar.launchpad.net/~cassidy/elisa-plugin-rtbf/trunk/revision/32 > 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? pyamf is shipped in the same egg as my plugin (I copied the structure of the weather plugin). See http://bazaar.launchpad.net/% 7Ecassidy/elisa-plugin-rtbf/trunk/files/head%3A/elisa/plugins/rtbf/ > 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), That could work (didn't test) but I don't like this solution because I don't think external deps should be present as the root of the egg. > 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. This doesn't work because in pyamf's internal files, they use "import pyamf", so my hack. Thanks for your help, > > G. > G. G. -- Guillaume Desmottes <[email protected]> Jabber <[email protected]> GPG 1024D/711E31B1 | 1B5A 1BA8 11AA F0F1 2169 E28A AC55 8671 711E 31B1
