durusmail: quixote-users: Stumped with sessions & SCGI
Stumped with sessions & SCGI
2002-09-21
2002-09-23
Stumped with sessions & SCGI
Andrew Kuchling
2002-09-23
On Sat, Sep 21, 2002 at 06:46:56PM -0700, Michael Watkins wrote:
>Could someone please share with me an example SCGI driver script developed
>with Quixote session support in mind?

Here's the top-level script for an application I'm working on.

--amk

from scgi.quixote_handler import debug, QuixoteHandler, main
from quixote import enable_ptl, publish, session

class QELEditorPublisher (publish.SessionPublisher):
    def __init__ (self, root_namespace):
        publish.SessionPublisher.__init__(self, root_namespace,
              session_mgr = session.SessionManager(QELEditorSession))
        self.read_config("/home/quixote/bin/qel-edit.conf")
        self.setup_logs()

class QELEditorSession (session.Session):
    def __init__ (self, request, id):
        session.Session.__init__(self, request, id)
        self.qt_num = None
        self.quotations = []

    def has_info (self):
        return 1

class QELEditorHandler (QuixoteHandler):
    publisher_class = QELEditorPublisher
    root_namespace = "qx.ui"
    prefix = ""

if __name__ == '__main__':
    enable_ptl()
    main(QELEditorHandler)


reply