[Twisted-Python] Remarks about the TAP to NT service tools (moonfallen sandbox)

Patrick Mézard patrick.mezard at ifrance.com
Wed Dec 1 08:08:28 EST 2004

I am trying to bundle a Twisted server based on a .TAC file into an NT service. 
I finally succeeded with the distutils extension available in moonfallen 
sandbox, here are the problems I met while doing it:

1- It is said in the readme.txt that win32all is required for the extension. 
It might be a bit misleading because the ActivePython version I use has it, 
but failed to generate the distutils package. What is actually needed is a 
win32all package version suitable for py2exe. And for the py2exe 0.5.4 I use, 
it means overwriting win32all with the build 206 for instance.

2- The readme says: "You can also use all the setup options that py2exe 
allows, such as includes and data_files.". I spend some times figuring why 
the 'typelibs' options I was passing were not taken into account. Again, 
this is really a distutils issue, but I guess there are others distutils 
newbies like me around. I was passing the 'typelibs' option to 'py2exe' as 
said in py2exe wiki, instead of 'twistedservice'.
from distutils.core import setup
import ntsvc

setup(	appconfig='my.tac',
		options = {
			"twistedservice": {\
	"typelibs": [('{F5078F18-C551-11D3-89B9-0000F81FE221}', 0, 4, 0)]}
works as expected.

I am aware the extension is experimental and unsupported but adding a line 
or two about the pitfalls above (which are purely distutils/py2exe related) 
into the readme may be useful for newcomers.

Besides, I actually need to specify the user account the service will use. 
I will send you patches if I managed to implement this, but I guess I need 
to be a bit more knowledgeable about the distutils and win32all service 
wrapper frameworks.

Thank you for the extension anyway, it's definitely useful and usable.

Patrick Mézard

More information about the Twisted-Python mailing list