Changeset 2660 for package_branches/invirt-web
- Timestamp:
- Dec 20, 2009, 9:43:41 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/cherrypy-rebased/code/main.fcgi
r1318 r2660 1 1 #!/usr/bin/python 2 import main 3 main.main() 2 """Main FastCGI entry point for web interface""" 3 4 import cherrypy 5 import os 6 import sys 7 from main import InvirtWeb 8 9 dev = False 10 base_dir = os.path.dirname(__file__) 11 12 if __name__=="__main__": 13 if len(sys.argv) > 1: 14 conf_file = sys.argv[1] 15 dev = True 16 else: 17 conf_file = os.path.join(base_dir, 'main.conf') 18 app = cherrypy.tree.mount(InvirtWeb(), '/' if dev else '/main.fcgi') 19 app.merge(conf_file) 20 cherrypy.config.update(conf_file) 21 22 if dev: 23 cherrypy.server.quickstart() 24 cherrypy.engine.start() 25 cherrypy.engine.block() 26 else: 27 cherrypy.engine.start(blocking=False) 28 from flup.server.fcgi import WSGIServer 29 server = WSGIServer(app) 30 server.run()
Note: See TracChangeset
for help on using the changeset viewer.