[Twisted-Python] twisted.web split

Thyrr thyrr at bb3.betterbox.net
Mon Apr 30 23:29:27 MDT 2001


How about splitting it into more files than that? It's a bit easier
generally to navigate and isolate problems, reuse for other things, and
update things. Maybe a file for CGI/epy code, a file for getting files and
such, a file for generating automatic directory listings, etc.

Just my suggestion (though I've only looked at Twisted Python for a few
days now, so maybe that's not a good way to do it?)

 - Thyrr at bb3.betterbox.net

On Mon, 30 Apr 2001, Moshe Zadka wrote:

> Hello, all.
> I talked a bit with glyph and radix about splitting twisted.web.
> It's over 1500 lines now, and I think it's becoming unmanageable.
> Here is how I propose it will be split:
> 
> - twisted/web/html.py -- HTML generation helpers
> - twisted/web/protocol.py -- Web protocols (HTTP and Gloop, currently)
> - twisted/web/resource.py -- Resources.
> 
> Specifically:
> 
> - twisted/web/resource.py
> 
> 	class Data(Resource):
> 	class Interface(Resource):
> 	class FileTransfer:
> 	class DirectoryListing(Interface):
> 	class File(Resource):
> 	class CGIDirectory(Resource):
> 	class ErrorPage(Interface):
> 	class NoResource(ErrorPage):
>         class ResourceIssue:
> 	class ResourceSubscription(Resource):
> 	class PythonScript(Resource):
> 	class CGIScript(Resource):
> 	class FilteredScript(CGIScript):
> 	class PHPScript(FilteredScript):
> 	class MethodDirectory(Interface):
> 	class UserDirectory(Interface):
> 
> - twisted/web/html.py
> 
> 	def escape(text):
> 	def PRE(text):
> 	def output(func, *args, **kw):
> 	def date_time_string(msSinceEpoch=None):
> 	def d(**z):
> 
> - twisted/web/protocol.py
> 
> 	class HTTP: (might move completely outside)
> 	class Request(http.HTTPRequestHandler):
> 	class CGIProcess(net.Process):
> 	class ResourcePublish(gloop.Handler):
> 	class ResourcePublisher(gloop.Server, authenticator.SessionManager):
> 	class HTTPHandler(net.GenericHandler):
> 	class Server(net.GenericServer, authenticator.SessionManager, config.Configurable):
> 	class HTTPClient(net.GenericClient, log.Logger):
> 	class HTTPCallback(HTTPClient):
> 	class ResourcePublisherClient(gloop.Client, log.Logger):
> 
> >From a simple grep I think I've covered everything.
> Anything else that might have slipped should be easy to put somewhere.
> 
> -- 
> "I'll be ex-DPL soon anyway so I'm        |LUKE: Is Perl better than Python?
> looking for someplace else to grab power."|YODA: No...no... no. Quicker,
>    -- Wichert Akkerman (on debian-private)|      easier, more seductive.
> For public key, finger moshez at debian.org  |http://www.{python,debian,gnu}.org
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> 






More information about the Twisted-Python mailing list