[Twisted-web] twisted.web and sharing class instances with CGI scripts

Fabian Steiner lists at fabis-site.net
Mon Apr 10 12:35:06 CDT 2006


Hello!

I am currently working on a quite complicated application (at least for
me) and unfortunately I don't know how to go on.

I wrapped a Windows-dll by using the ctypes module so that I can access
different functions that are used to control a network device (open,
close, write/read values). Now I was asked to write something like a GUI
for it which should be based on a CGI script that calls the different
functions (read/write) with parameters entered in a text-input of a
HTML-Template.
Therefore I wrote a small HTTP-Server class based on twisted.web. In its
constructor the network device is opened (--> the wrapper class is
initiated) and is closed by the server's destructor. Now I need the same
wrapper class instance in my CGI script so that read() and write() can
be called on exactly the same instance - otherwise these methods would
fail since the network device hasn't been opened so far.

Do you have any idea how to solve this problem? I am looking forward to
any responses.

Cheers,
Fabian




More information about the Twisted-web mailing list