~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to start-loggerhead.py

  • Committer: Jelmer Vernooij
  • Date: 2011-09-08 00:33:28 UTC
  • mfrom: (422.5.2 1.18)
  • mto: This revision was merged to the branch mainline in revision 457.
  • Revision ID: jelmer@samba.org-20110908003328-vu1ps5w21gohws2f
mergeĀ lp:loggerhead/1.18.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
import turbogears
6
 
import cherrypy
7
 
cherrypy.lowercase_api = True
8
 
 
9
 
from os.path import *
10
 
import sys
11
 
 
12
 
# first look on the command line for a desired config file,
13
 
# if it's not on the command line, then
14
 
# look for setup.py in this directory. If it's not there, this script is
15
 
# probably installed
16
 
if len(sys.argv) > 1:
17
 
    turbogears.update_config(configfile=sys.argv[1], 
18
 
        modulename="loggerhead.config")
19
 
elif exists(join(dirname(__file__), "setup.py")):
20
 
    turbogears.update_config(configfile="dev.cfg",
21
 
        modulename="loggerhead.config")
22
 
else:
23
 
    turbogears.update_config(configfile="prod.cfg",
24
 
        modulename="loggerhead.config")
25
 
 
26
 
from loggerhead.controllers import Root
27
 
 
28
 
turbogears.start_server(Root())