|
osdir.com mailing list archive |
|
|
|
Subject: Re: recursive add directory - msg#00085List: python.py2exe
Did it but it should be available from py2exe (maybe I missed it in
the crumbled doc ;-) ). import os def tree(src): return [(root, map(lambda f: os.path.join(root, f), files)) for (root, dirs, files) in os.walk(os.path.normpath(src))] data_files += tree(MY_BIG_DIR) -- jt
Thread at a glance:
Previous Message by Date: (click to view message preview)Re: recursive add directoryOK but I have to keep the directory structure and I don't want to write a line in setup.py for every subdir. I'm working in Cygwin: my workaround is to do it in my Makefile ("cp -Lrv src dest", yes I just need this) but I wan't to be able to build my app on a "virgin" Windows. On 2/22/06, Harald Armin Massa <haraldarminmassa@xxxxxxxxx> wrote: > 1.) get http://www.jorendorff.com/articles/python/path/ > path modul from jason > > 2.) look at walkfiles and files there. It does nearly exactly what you want > datafiles=("disttbigdi",[list(path.walkfiles())]) -- jt Next Message by Date: click to view message previewSingle-file creation: winrarHi folks... I've been trying to figure out a good way to bundle together a py2exe 'dist' directory into a single-file executable. A lot of people have suggested NSIS as a solution, but I've got an easier one: winrar. Winrar lets you create a self-extracting executable that can (1) extract to a temporary location, (2) run a program within the temp folder, and (3) delete the temp folder when the program exits. It also lets you suppress all winrar-specific output, so the process is entirely transparent to the user. --Steve Stephen Gross Case Western School of Medicine Cleveland, OH "By Grabthar's hammer, by the sons of Worvan, you shall be avenged." - Dr. Lazarus ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 Previous Message by Thread: click to view message previewRe: recursive add directoryOK but I have to keep the directory structure and I don't want to write a line in setup.py for every subdir. I'm working in Cygwin: my workaround is to do it in my Makefile ("cp -Lrv src dest", yes I just need this) but I wan't to be able to build my app on a "virgin" Windows. On 2/22/06, Harald Armin Massa <haraldarminmassa@xxxxxxxxx> wrote: > 1.) get http://www.jorendorff.com/articles/python/path/ > path modul from jason > > 2.) look at walkfiles and files there. It does nearly exactly what you want > datafiles=("disttbigdi",[list(path.walkfiles())]) -- jt Next Message by Thread: click to view message previewRE: recursive add directoryjt wrote: > Did it but it should be available from py2exe (maybe I missed it in > the crumbled doc ;-) ). > > import os > > def tree(src): > return [(root, map(lambda f: os.path.join(root, f), files)) > for (root, dirs, files) in os.walk(os.path.normpath(src))] > > data_files += tree(MY_BIG_DIR) Nope, you didn't miss it in the docs. The data_files option is actually a distutils feature rather than a py2exe feature (remember that py2exe is a distutils extension). So that is where it would need to be changed. I'm not aware of the reasoning behind this behavior (e.g., is it intentional, or did nobody ever get around to it?). Jimmy ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
Web Hosting Reviews from OSDir.com Sister Site iBizWebHosting.com
|
|