[Twisted-Python] loading application files from zip files for frozen exes

Grant McDonald gmcdonald at infocomp.com
Sun Jun 26 18:11:40 MDT 2005


Hi All,

When packaging a twisted server implementation with py2exe that uses .tac
(.py) files one ends up with a zip file with all the python dependencies (as
.pyo bytecode), an .exe and the .tac files in the package directory. To me
this seems a bit messy since the distribution is by definition a 'frozen'
exe and any changes to the python modules in the zip will require a rebuild.

With this limitation in mind I initially wrote several patches to twisted
core modules to allow an application to be loaded from a zip file (only .py
modules) which i attached to issue 1092
(http://twistedmatrix.com/bugs/issue1092). Upon further reflection I
realised that this functionality is only really useful in the case of exes
frozen with py2exe and I rewrote my patch to be completely external to the
twisted core (code and test modules which i have attached to this mail).
Would you consider perhaps inclusion of this in the twisted/scripts
directory with a short note in a howto?

Regards,

Grant M

P.S. this allows you to specify:

twistd.exe -y <name>

where <name> is the python module name without the .py

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20050627/0a934460/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arc_twistw.py
Type: application/octet-stream
Size: 3783 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20050627/0a934460/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: exesetup.py
Type: application/octet-stream
Size: 1335 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20050627/0a934460/attachment-0007.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_arc_twistw.py
Type: application/octet-stream
Size: 1067 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20050627/0a934460/attachment-0008.obj>


More information about the Twisted-Python mailing list