Example #1
0
def main():
    opts = parse_arguments()

    level = logging.INFO
    if opts.debug:
        level = logging.DEBUG
    logging.basicConfig(level=level)

    if opts.config_path:
        ConfigLoader.set_config_location(opts.config_path)

    if not opts.document_root:
        logging.error('Document root not provided')
        raise SystemExit(1)

    logging.debug('configuration at: %s', ConfigLoader.CONFIG_PATH)

    if opts.helpers_dir:
        ServiceReloader.set_helpers_dir(opts.helpers_dir)

    if opts.ia:
        logging.error('Image Analyzer mode')
        app = Application(opts.document_root, mode=Application.MODE_AO)
    else:
        app = Application(opts.document_root)

    logging.debug('listening on port %d', opts.http_port)
    app.listen(opts.http_port)

    logging.debug('starting...')
    IOLoop.instance().start()
Example #2
0
def main():
    opts = parse_arguments()

    level = logging.INFO
    if opts.debug:
        level = logging.DEBUG
    logging.basicConfig(level=level)

    if opts.config_path:
        ConfigLoader.set_config_location(opts.config_path)

    if not opts.document_root:
        logging.error('Document root not provided')
        raise SystemExit(1)

    logging.debug('configuration at: %s', ConfigLoader.CONFIG_PATH)

    if opts.helpers_dir:
        ServiceReloader.set_helpers_dir(opts.helpers_dir)

    if opts.ia:
        logging.error('Image Analyzer mode')
        app = Application(opts.document_root, mode=Application.MODE_AO)
    else:
        app = Application(opts.document_root)

    logging.debug('listening on port %d', opts.http_port)
    app.listen(opts.http_port)

    logging.debug('starting...')
    IOLoop.instance().start()