Back in 2010, Martin Zibricky wrote about adding a folder to --onefile. The method was simply to change the following:
coll = COLLECT(exe, a.binaries, ...
to:
coll = COLLECT(exe, a.binaries + [('testFolder', 'C:/testFolder', 'DATA')], ...
Goebel Consult
http://www.goebel-consult.de
Monatliche Kolumne:
http://www.cissp-gefluester.de/2011-02-fleisige-datensammler-fur-lukratives-geschaeftsmodell-gesucht
Blog:
http://www.goebel-consult.de/blog/20060121
Goebel Consult ist Mitglied bei http://www.7-it.de/
Am 12.05.2013 13:07, schrieb Laurence Anthony:
Back in 2010, Martin Zibricky wrote about adding a folder to --onefile. The method was simply to change the following:
coll = COLLECT(exe, a.binaries, ...
to:
coll = COLLECT(exe, a.binaries + [('testFolder', 'C:/testFolder', 'DATA')], ...
I doubt, this ever as been working, as DATA is marking a file ever since.
You could try adding a hidden file, which should create the directory:
[('testFolder/.dummy', 'some_empty_file', 'DATA')]
--
def extra_datas(mycwd,mydir):
that TREE can be used to walk through a directory. However, I couldn't get this to work and had use the above script to walk through the directory myself.
Goebel Consult
http://www.goebel-consult.de
def extra_datas(mycwd,mydir):
This looks like you are reimplementing os.walk(). And to be frank: this is ugly, ugly code (I'm glad that it's not yours, so I can say this :-)
Well, the function is called "Tree", not "TREE", you can find the documentation here:
that TREE can be used to walk through a directory. However, I couldn't get this to work and had use the above script to walk through the directory myself.
<http://www.pyinstaller.org/export/v2.0/project/doc/Manual.html?format=raw#tree>
What is your exact problem with it? (I have not used it yet, but it looks as if it would solve your problem. Thanks for ponting to it :-)
It might work. I just don't understand the docs! :-). If I call Tree(mydir), what exactly is returned. A list? A string? An iterator?
Goebel Consult
http://www.goebel-consult.de
Am 14.05.2013 13:36, schrieb Laurence Anthony:
Yes, it's a bit short :-) Thanks to Nat Picker there is a better description available now:It might work. I just don't understand the docs! :-). If I call Tree(mydir), what exactly is returned. A list? A string? An iterator?
<https://rawgithub.com/pyinstaller/pyinstaller/develop/doc/Manual.html#the-tree-class>
Is this understandable for you? (Otherwise we should again improve it)
So, if Tree is creating a TOC, how does root, prefix, (and excludes) relate to (name, path, typecode) of TOC.
So, how do I get c:/mydir into the dist folder?
Goebel Consult
http://www.goebel-consult.de
Good point.
So, if Tree is creating a TOC, how does root, prefix, (and excludes) relate to (name, path, typecode) of TOC.
From the code I can tell you, that the typecode is always DATA.
For the rest I suggest testing it. I'v done it four you:
print Tree('xx')
# [('yy/zz.txt', 'xx/yy/zz.txt', 'DATA')]
print Tree('xx', 'aaa')
# [('aaa/yy/zz.txt', 'xx/yy/zz.txt', 'DATA')]
print Tree('/usr/share/icons/large', 'my-icons')
# [('my-icons/mageiaupdate.png', '/usr/share/icons/large/mageiaupdate.png', 'DATA'), ...
For me this is quite obvioseSimply list it, lika any other TOC:
So, how do I get c:/mydir into the dist folder?
COLLECT(a.binaries,
a.pure,
Tree('c:/mydir'),
...
> An example explaining this would be really useful.Please open an issue for this, including the examples above.
Wonderful. So clear and obvious. If the manual had this in it, everything would make sense.
Goebel Consult
http://www.goebel-consult.de
Monatliche Kolumne:
http://www.cissp-gefluester.de/2012-02-bring-your-own-life-glosse
Blog:
http://www.goebel-consult.de/blog/200505010