示例#1
0
 def __init__(self, config_file):
     handlers = [
         (r"/summary?(.+)",              summary.SummaryHandler)
     ]
     
     settings = config.parse_config(config_file)
     
     cyclone.web.Application.__init__(self, handlers, **settings)
示例#2
0
    def __init__(self, config_file):
        handlers = [
            (r"/summary",              summary.SummaryHandler),
            (r"/detail",               detail.DetailHandler)
        ]

        logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)
        
        settings = config.parse_config(config_file)
        if not settings['metrics_out']:
            raise ValueError

        database.bootstrap_database(settings['metrics_out'], settings['summary_file'])
        
        cyclone.web.Application.__init__(self, handlers, **settings)