|
Revision 28, 0.8 kB
(checked in by tim, 5 years ago)
|
|
easy_config can now be turned on/off by setting the easy_config.enabled
property in [dev|prod|test|app].cfg. Defaults to True
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
LastChangedBy LastChangedRevision LastChangedDate HeadURL
|
| Line | |
|---|
| 1 | #!/usr/local/bin/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="cogplanet.config") |
|---|
| 18 | elif exists(join(dirname(__file__), "setup.py")): |
|---|
| 19 | update_config(configfile="dev.cfg",modulename="cogplanet.config") |
|---|
| 20 | else: |
|---|
| 21 | update_config(configfile="prod.cfg",modulename="cogplanet.config") |
|---|
| 22 | |
|---|
| 23 | import cogplanet.easy_config |
|---|
| 24 | |
|---|
| 25 | from cogplanet.controllers import PlanetController |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | start_server(PlanetController()) |
|---|