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