Changeset 2739 for package_branches/invirt-web/cherrypy-rebased/code
- Timestamp:
- Dec 21, 2009, 12:05:15 AM (15 years ago)
- Location:
- package_branches/invirt-web/cherrypy-rebased/code
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/cherrypy-rebased/code/invirt.fcgi
r2734 r2739 12 12 13 13 def usage(): 14 print >>sys.stderr, """%s [config] 14 argv0_dir = os.path.dirname(sys.argv[0]) 15 print >>sys.stderr, """%s <unauth|auth> [config] 16 %s/auth.fcgi [config] 17 %s/unauth.fcgi [config] 15 18 16 19 Run server as FastCGI, with CherryPy config from "main.conf". … … 19 22 20 23 Run this script as either 'auth.fcgi' or 'unauth.fcgi', to get 21 the authenticated or unauthenticated site respectively. 22 """ % sys.argv[0] 24 the authenticated or unauthenticated site respectively, or pass 25 'auth' or 'unauth' as the first parameter. 26 """ % (sys.argv[0], argv0_dir, argv0_dir) 23 27 sys.exit(2) 24 28 25 29 if __name__ == "__main__": 26 if len(sys.argv) > 2:30 if len(sys.argv) > 3 or len(sys.argv) == 1 or '-h' in sys.argv or '--help' in sys.argv: 27 31 usage() 28 if len(sys.argv) > 1: 29 if sys.argv[1] in ('-h', '--help'): 30 usage() 31 conf_file = sys.argv[1] 32 if len(sys.argv) == 3: 33 mode = sys.argv[1] 34 conf_file = sys.argv[2] 32 35 dev = True 33 36 else: 37 mode = sys.argv[1] 34 38 conf_file = os.path.join(base_dir, 'main.conf') 35 39 … … 40 44 } 41 45 42 if os.path.basename(sys.argv[0]).startswith('auth'):46 if mode.startswith('auth'): 43 47 root = main.InvirtWeb() 44 elif os.path.basename(sys.argv[0]).startswith('unauth'): 48 app_config['/']['tools.mako.module_directory'] = "/tmp/invirt-auth-web-templatecache" 49 elif mode.startswith('unauth'): 45 50 root = main.InvirtUnauthWeb() 51 app_config['/']['tools.mako.module_directory'] = "/tmp/invirt-unauth-web-templatecache" 46 52 else: 47 53 usage() -
package_branches/invirt-web/cherrypy-rebased/code/main.conf
r2670 r2739 3 3 #auto_reload doesn't work with FastCGI 4 4 engine.auto_reload = False 5 tools.mako.module_directory = "/tmp/invirt-web-templatecache"6 5 tools.remote_user_login.on = True 7 6
Note: See TracChangeset
for help on using the changeset viewer.