def __init__(self, app, session): self._session = session Object.__init__(self, app) CGIScript.__init__(self, None) self._invariant()
def __init__(self, filename, filter): CGIScript.__init__(self, filename) self.filter = filter
# # https://jcalderone.livejournal.com/tag/sixty%20seconds import sys if __package__: from . import daemon_factory else: import daemon_factory #raise Exception("Not implemented yet") # Possible implementation: Iterate on all CGI scripts: if False: from twisted.web.twcgi import CGIScript resource = CGIScript("/survol/entity.py") def start_server(): daemon_factory.supervisor_startup() # There is a standard way to start a defined twisted server, from the command line. if False: from twisted.web.resource import Resource from twisted.web import server class MySite(Resource): def render_GET(self, request): request.write("<!DOCTYPE html>") request.write("<html><head>") request.write("<title>Twisted Driven Site</title>")