WebRequestDispatcher

Inheritance:

Methods of WebRequestDispatcher:

__init__
def __init__(self, wantLandingPage=True)

Undocumented function.

__new__
def __new__(self, *a, **kw)

Undocumented function.

_main
def _main(self)

Undocumented function.

_services
def _services(self)

Undocumented function.

_stylesheet
def _stylesheet(self, **kw)

Undocumented function.

enableLandingPage
def enableLandingPage(self, enable)

Undocumented function.

handleGET
def handleGET(self, req)

Parse and dispatch a single GET request. Expects to receive a WebRequest object.

invalidURI
def invalidURI(self, replyTo, **kw)

Undocumented function.

listenOnPort
def listenOnPort(self, listenPort)

Start the web server listening if it isn't already. Singleton server, so ignore multiple listen requests.

poll
def poll(self)

Pump the web server, handle any incoming requests. This function should be called regularly, about 2-4 calls/sec for current applications is a good number.

pollHTTPTask
def pollHTTPTask(self, task)

Undocumented function.

registerGETHandler
def registerGETHandler(self, uri, handler, returnsResponse=False, autoSkin=False)

Call this function to register a handler function to be called in response to a query to the given URI.
GET options are translated into **kw arguments. Handler function should accept **kw in order to handle arbitrary queries.
If returnsResponse is False, the request is left open after handler returns--handler or tasks it creates are responsible for fulfilling the query now or in the future. Argument replyTo (a WebRequest) is guaranteed to be passed to the handler, and replyTo.respond must be called with an HTML response string to fulfill the query and close the socket.
If returnsResponse is True, WebRequestDispatcher expects the handler to return its response string, and we will route the response and close the socket ourselves. No replyTo argument is provided to the handler in this case.

startCheckingIncomingHTTP
def startCheckingIncomingHTTP(self, interval=0.3)

Undocumented function.

stopCheckingIncomingHTTP
def stopCheckingIncomingHTTP(self)

Undocumented function.

unregisterGETHandler
def unregisterGETHandler(self, uri)

Undocumented function.