Changeset 3776
- Timestamp:
- 11/27/07 16:37:09 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/turbogears/qstemplates/quickstart/setup.py_tmpl
r3031 r3776 1 # -*- coding: UTF-8 -*- 2 1 3 from setuptools import setup, find_packages 2 4 from turbogears.finddata import find_package_data … … 31 33 #end if 32 34 ], 33 scripts=["start-${package}.py"],34 35 zip_safe=False, 35 36 packages=packages, … … 69 70 ], 70 71 test_suite='nose.collector', 72 entry_points = { 73 'console_scripts': [ 74 'start-${package} = ${package}.commands:start', 75 ], 76 }, 77 # Uncomment next line and create a default.cfg file in your project dir 78 # if you want to package a default configuration in your egg. 79 #data_files = [('config', ['default.cfg'])], 71 80 ) 72 81 branches/1.1/turbogears/qstemplates/quickstart/start-+package+.py_tmpl
r3063 r3776 1 1 #!${sys_executable} 2 import pkg_resources 3 pkg_resources.require("TurboGears") 2 # -*- coding: UTF-8 -*- 3 """Start script for the ${project} TurboGears project. 4 4 5 from turbogears import config, update_config, start_server 6 import cherrypy 7 cherrypy.lowercase_api = True 8 from os.path import * 5 This script is only needed during development for running from the project 6 directory. When the project is installed, easy_install will create a 7 proper start script. 8 """ 9 9 10 import sys 11 from ${package}.commands import start, ConfigurationError 10 12 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="${package}.config") 18 elif exists(join(dirname(__file__), "setup.py")): 19 update_config(configfile="dev.cfg",modulename="${package}.config") 20 else: 21 update_config(configfile="prod.cfg",modulename="${package}.config") 22 config.update(dict(package="${package}")) 23 24 from ${package}.controllers import Root 25 26 start_server(Root()) 13 if __name__ == "__main__": 14 try: 15 start() 16 except ConfigurationError, exc: 17 sys.stderr.write(str(exc)) 18 sys.exit(1)