From: Jaime B. J. <j.b...@gm...> - 2012-11-09 15:09:30
|
Yes I have used this code lines: *print(os.getcwd(),os.curdir)* *print(os.path.dirname(sys.executable))* *print("Voy a buscar un plugin")* *print(self.manager.getPluginsOfCategory("Formatters"), self.manager.getAllPlugins())* * * And I have obtained this results: *('C:\\Users\\Jaime\\Python\\PImageQT\\src\\dist', '.') * *C:\Users\Jaime\Python\PImageQT\src\dist* *Voy a buscar un plugin* *([], [])* * * Thank you very much. 2012/11/9 Ronald Oussoren <ron...@ma...> > > On 9 Nov, 2012, at 15:45, Jaime Barrio Jimenez <j.b...@gm...> > wrote: > > ok, this is my problem: > > I'm working with Python. My file GUI.py uses Yapsy for including new > plugins into my software. I have finished all my work and now I want to use > py2exe to generate a executable. I don't know how can I order py2exe to > include Yapsy and all their modules. I have tried that and it doesn't work: > > opts = { > 'py2exe': { "includes" : ["yapsy.PluginManager","sip", > "matplotlib.backends", "matplotlib.backends.backend_qt4agg", > "matplotlib.figure","pylab", > "numpy","matplotlib.backends.backend_tkagg"]} > > ... > > setup( > name='PImageQT', > version='1.0', > author='Jaime', > package={'images/*', 'Windows6S/*', 'modulos6S/*', > 'OperacionesPlugins/*'}, > scripts=['GUI.py'], > console=["GUI.py"], > options=opts, > data_files=data_files, > zipfile=None > ) > > I have found something in this link [ > http://notinthestars.blogspot.com.es/2011/04/using-python-plugin-scripts-with-py2exe.html][1] > but it doesn't solve my problem. > > In my Gui.py file for each plugin I add an action into a menu. This menu > in the executable doesn't appear. > > Does anyone know how I must do it? > > Thank you very much. > > Edit: > > I have used breakpoints and yapsy works fine, but it doesn't found my > plugins directory. The directory's name is the same. > > Edit 2: > > The path is ok and the directory is into the path. I don't know why it > doesn't find the plugins directory after packing with py2exe. My code line > for set the directory is the same like other web pages: > self.manager.setPluginPlaces(["plugins"]) > > Edit 3: > > I tried use a relative path to search the plugins and, it doesn't work. > self.manager.setPluginPlaces([os.getcwd() + os.sep + "plugins"]) > > > Have to tried printing the current working directory? Your program > environment might be different that you expect, especially when you don't > start the executable from a command shell window. > > Ronald > -- Un Saludo Atentamente Jaime Barrio. ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ingeniero Informático (UPM) Linkedin <http://es.linkedin.com/pub/jaime-barrio-jimenez/32/363/311> ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |