alexandernst píše v Ne 05. 09. 2010 v 16:01 -0700:
> I have a "libs" folder that has my own libraries. Those are detected
> tweaking the spec file.
> But I also have a "plugins" directory. In that one I have scripts that
> are imported with __import__ at runtime, and they
> aren't detected by pyinstaller. Or maybe I'm doing something wrong :/

the solution could be like with 'skins' folder:

[('plugins', '/my/project/plugins', 'DATA')] - your plugin files should
be packaged with your binary.

and at runtime add it to your Python path:

sys.path.append(
    os.path.join(os.environ["_MEIPASS2], 'plugins'))
) 

> Anyways, there is a third folder called "skins". That one includes a
> lot of folders and each folder is a skin. How can I include the
> entire "skins" folder in my executable file?

Pyinstaller should support that. However I didn't use that yet. But:

In your spec file you should tweak the collect section.

 coll = COLLECT(exe,
                a.binaries,
                a.zipfiles,
                a.datas,
                strip=False,
                upx=False,
                name=os.path.join('dist', __testname__))

like:

 coll = COLLECT(exe,
                a.binaries +
                [('skins', '/my/project/skins', 'DATA')],
                a.zipfiles,
                a.datas,
                strip=False,
                upx=False,
                name=os.path.join('dist', __testname__))

the skins folder should be accessible at runtime like:

os.path.join(os.environ["_MEIPASS2], 'skins'))

in pyinstaller doc see:

http://www.pyinstaller.org/export/latest/tags/1.4/doc/Manual.html?format=raw#toc-class-table-of-contents
http://www.pyinstaller.org/export/latest/tags/1.4/doc/Manual.html?format=raw#accessing-data-files


Hope it will work for you.

Regards Martin


-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" 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/pyinstaller?hl=en.

Reply via email to