cryptonas-branches/pythonrewrite/bin2/CryptoBoxWebserver.py
age 697d5f9b0c webserver, sites and settings splitted
included some new functions from the perl file
the clearsilver templates have to be modified next
2006-08-24 00:06:19 +00:00

34 lines
927 B
Python
Executable file

#!/usr/bin/env python2.4
import os
import CryptoBoxWebserverSites
try:
import cherrypy
except:
print "could not import cherrypy module! Try apt-get install python-cherrypy."
sys.exit(1)
class CryptoBoxWebserver:
'''this class starts the cherryp webserver and serves the single sites'''
def __init__(self):
cherrypy.root = CryptoBoxWebserverSites.CryptoBoxWebserverSites()
#expose static content:
#I currently have no idea how to cleanly extract the stylesheet path from
#the config object without an extra CryptoBox.CryptoBoxProps instance.
#perhaps put config handling into a seperate class in CryptoBox.py?
cherrypy.config.configMap.update(
{
"/cryptobox.css": {
"staticFilter.on" : True,
"staticFilter.file": os.path.abspath("../www-data/cryptobox.css" )
}
})
def start(self):
cherrypy.server.start()
if __name__ == "__main__":
cbw = CryptoBoxWebserver()
cbw.start()