|
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 |
|---|
| 2 | import pkg_resources |
|---|
| 3 | pkg_resources.require("TurboGears") |
|---|
| 4 | |
|---|
| 5 | from turbogears import update_config, start_server |
|---|
| 6 | import cherrypy |
|---|
| 7 | cherrypy.lowercase_api = True |
|---|
| 8 | from os.path import * |
|---|
| 9 | import 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 |
|---|
| 15 | if len(sys.argv) > 1: |
|---|
| 16 | update_config(configfile=sys.argv[1], |
|---|
| 17 | modulename="videostore.config") |
|---|
| 18 | elif exists(join(dirname(__file__), "setup.py")): |
|---|
| 19 | update_config(configfile="dev.cfg",modulename="videostore.config") |
|---|
| 20 | else: |
|---|
| 21 | update_config(configfile="prod.cfg",modulename="videostore.config") |
|---|
| 22 | |
|---|
| 23 | from videostore.controllers import Root |
|---|
| 24 | |
|---|
| 25 | start_server(Root()) |
|---|