This repository has been archived on 2023-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
2007-07-16 20:22:38 +00:00
|
|
|
import cherrypy
|
|
|
|
from controller.Database import Database
|
|
|
|
from controller.Root import Root
|
|
|
|
from controller.Scheduler import Scheduler
|
|
|
|
from config import Common
|
|
|
|
|
|
|
|
|
|
|
|
def main( args ):
|
|
|
|
scheduler = Scheduler()
|
|
|
|
database = Database( scheduler, "data.db" )
|
|
|
|
|
|
|
|
cherrypy.config.update( Common.settings )
|
|
|
|
|
|
|
|
if len( args ) > 0 and args[ 0 ] == "-d":
|
|
|
|
from config import Development
|
2007-08-02 18:52:20 +00:00
|
|
|
settings = Development.settings
|
2007-07-16 20:22:38 +00:00
|
|
|
else:
|
|
|
|
from config import Production
|
2007-08-02 18:52:20 +00:00
|
|
|
settings = Production.settings
|
|
|
|
|
|
|
|
cherrypy.config.update( settings )
|
|
|
|
|
|
|
|
cherrypy.lowercase_api = True
|
|
|
|
root = Root( scheduler, database, cherrypy.config.configMap )
|
|
|
|
cherrypy.root = root
|
2007-07-16 20:22:38 +00:00
|
|
|
|
|
|
|
if scheduler.shutdown not in cherrypy.server.on_stop_server_list:
|
|
|
|
cherrypy.server.on_stop_server_list.append( scheduler.shutdown )
|
|
|
|
|
|
|
|
cherrypy.server.start()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
import sys
|
|
|
|
main( sys.argv[ 1: ] )
|