Esempio n. 1
0
def main(settings):
    manager = import_string(settings.APPLICATION_MANAGER)
    app_manager = manager.ApplicationManager(settings)
    try:
        app_manager.run()
    except KeyboardInterrupt:
        print "interrupted"
Esempio n. 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)
Esempio n. 3
0
 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]