cryptonas-branches/pythonrewrite/bin2/CryptoBoxWebserver.py

26 lines
771 B
Python
Raw Normal View History

2006-08-16 14:52:23 +02:00
#!/usr/bin/env python
import cherrypy, neo_cgi, neo_util, neo_cs, os
class RunCmd:
def index(self):
print "ooooooooooooooooooooooooooooooo"
print os.path.abspath("./")
hdf = neo_util.HDF()
#hdf.setValue("hdf.loadpaths.0","/my/path")
hdf.readFile("../lang/de.hdf")
hdf.setValue("Settings.TemplateDir","../templates")
hdf.setValue("Settings.Stylesheet","cryptobox.css")
hdf.setValue("Data.Action","show_status")
cs = neo_cs.CS(hdf)
cs.parseFile("../templates/main.cs")
return cs.render()
index.exposed = True
#####
cherrypy.root = RunCmd()
#cherrypy.lib.cptools.serve_file("/tmp/cryptobox.css")
cherrypy.config.configMap.update({ "/cryptobox.css": {
"staticFilter.on" : True, "staticFilter.file": "/tmp/cryptobox.css" }})
cherrypy.server.start()