[Pyobjc-dev] Don't want to ship sources
Brought to you by:
ronaldoussoren
From: Bob S. <rsw...@tr...> - 2003-06-26 17:56:58
|
Has anyone tried to create a PyObjC application that includes only compiled files rather than Python sources scripts? I'm preparing a PyObjC application for distribution and we don't want to ship the source files. I've found that I can just change the buildapp.py to include *.pyc files and everything works fine - except that the python interpreter doesn't want to give me compiled files for every class. So, my question is - is there a way to force python to create compiled files for each class? My approach has been to add this code to the buildapp.py file: liststrFiles = [ fn[0 : len(fn-len(".py")] for fn in os.listdir('.') if fn.endswith('.py') and fn not in ('buildapp.py', "myApp.py") ] for str in lststrFiles: exec("import " + str) srcs = [ fn for fn in os.listdir('.') if fn.endswith(".pyc") ] and then to add srcs to the resources line in buildapp(). I don't include the main script "myApp.py" since python gets confused about the NIB stuff. Anyway, this approach doesn't work because not all of the files get compiled into *.pyc files. Is there any way to force this or is there another approach to building the app without sources? Thanks, Bob Swerdlow COO Transpose rsw...@tr... 207-781-8284 http://www.transpose.com ---------------------------------- Fight Spam! Add this link to your signature (as I did): http://wecanstopspam.org Click through to find out more. ---------------------------------- |