WebStack

Annotated examples/Twisted/CalendarApp.py

308:31978c2f9b87
2004-12-20 paulb [project @ 2004-12-20 21:05:10 by paulb] Added notes on JythonServlet configuration. Updated Twisted notes.
paulb@26 1
#!/usr/bin/env python
paulb@26 2
paulb@26 3
from WebStack.Adapters import Twisted
paulb@26 4
from Calendar import DirectoryResource
paulb@26 5
import twisted.web.server
paulb@26 6
import twisted.internet.reactor
paulb@26 7
paulb@26 8
# Special magic incantation.
paulb@26 9
paulb@26 10
top_level = Twisted.Dispatcher(DirectoryResource())
paulb@26 11
site = twisted.web.server.Site(top_level)
paulb@26 12
twisted.internet.reactor.listenTCP(8080, site)
paulb@265 13
print "Serving..."
paulb@26 14
twisted.internet.reactor.run()
paulb@26 15
paulb@26 16
# vim: tabstop=4 expandtab shiftwidth=4