root / elixir / trunk / examples / videostore / start-videostore.py

Revision 501, 0.8 kB (checked in by ged, 3 years ago)

PEP8 improvements in examples. Not sure it's worth it, since it is so outdated.

Line 
1#!/Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python
2import pkg_resources
3pkg_resources.require("TurboGears")
4
5from turbogears import update_config, start_server
6import cherrypy
7cherrypy.lowercase_api = True
8from os.path import *
9import sys
10
11# first look on the command line for a desired config file,
12# if it's not on the command line, then
13# look for setup.py in this directory. If it's not there, this script is
14# probably installed
15if len(sys.argv) > 1:
16    update_config(configfile=sys.argv[1],
17        modulename="videostore.config")
18elif exists(join(dirname(__file__), "setup.py")):
19    update_config(configfile="dev.cfg",modulename="videostore.config")
20else:
21    update_config(configfile="prod.cfg",modulename="videostore.config")
22
23from videostore.controllers import Root
24
25start_server(Root())
Note: See TracBrowser for help on using the browser.