Exemplo n.º 1
0
def madmin_start(args, db_wrapper: DbWrapperBase, ws_server, mapping_manager: MappingManager, deviceUpdater,
                 jobstatus):
    # load routes

    statistics(db_wrapper, args, app, mapping_manager)
    control(db_wrapper, args, mapping_manager, ws_server, logger, app, deviceUpdater)
    map(db_wrapper, args, mapping_manager, app)
    config(db_wrapper, args, logger, app, mapping_manager)
    path(db_wrapper, args, app, mapping_manager, jobstatus)

    app.config["SEND_FILE_MAX_AGE_DEFAULT"] = 0
    app.logger.removeHandler(default_handler)
    logging.basicConfig(handlers=[InterceptHandler()], level=0)
    app.run(host=args.madmin_ip, port=int(args.madmin_port), threaded=True)
Exemplo n.º 2
0
def madmin_start(arg_args, arg_db_wrapper, ws_server):
    # load mappings
    mapping_parser = MappingParser(arg_db_wrapper, arg_args)

    # load routes
    statistics(arg_db_wrapper, arg_args, app)
    control(arg_db_wrapper, arg_args, mapping_parser, ws_server, logger, app)
    map(arg_db_wrapper, arg_args, mapping_parser, app)
    config(arg_db_wrapper, arg_args, logger, app)
    ocr(arg_db_wrapper, arg_args, logger, app)
    path(arg_db_wrapper, arg_args, app)

    httpsrv = WSGIServer((arg_args.madmin_ip, int(arg_args.madmin_port)),
                         app.wsgi_app,
                         log=LogLevelChanger)
    httpsrv.serve_forever()
Exemplo n.º 3
0
def madmin_start(args, db_wrapper: DbWrapperBase, ws_server,
                 mapping_manager: MappingManager, data_manager, deviceUpdater,
                 jobstatus):
    # load routes
    if args.madmin_base_path:
        app.wsgi_app = ReverseProxied(app.wsgi_app,
                                      script_name=args.madmin_base_path)

    statistics(db_wrapper, args, app, mapping_manager)
    control(db_wrapper, args, mapping_manager, ws_server, logger, app,
            deviceUpdater)
    map(db_wrapper, args, mapping_manager, app)
    APIHandler(logger, args, app, data_manager)
    config(db_wrapper, args, logger, app, mapping_manager, data_manager)
    path(db_wrapper, args, app, mapping_manager, jobstatus)

    app.logger.removeHandler(default_handler)
    logging.basicConfig(handlers=[InterceptHandler()], level=0)
    app.run(host=args.madmin_ip, port=int(args.madmin_port), threaded=True)