示例#1
0
def main(settings):
    manager = import_string(settings.APPLICATION_MANAGER)
    app_manager = manager.ApplicationManager(settings)
    try:
        app_manager.run()
    except KeyboardInterrupt:
        print "interrupted"
示例#2
0
def runcli():
    parser = optparse.OptionParser()
    parser.add_option('--settings', dest='settings',
        default='hurricane.default_settings')

    options, args = parser.parse_args()
    settings = import_string(options.settings)
    main(settings)
示例#3
0
文件: base.py 项目: ericflo/hurricane
 def __init__(self, settings, publisher):
     self.publisher = publisher
     self.settings = settings
     self.handler_classes = [import_string(handler) for handler in settings.HANDLERS]
     self.handlers = [obj(settings, self) for obj in self.handler_classes]