diff --git a/dist/app-1.0.0-py3-none-any.whl b/dist/app-1.0.0-py3-none-any.whl index 1de5204..00118f9 100644 Binary files a/dist/app-1.0.0-py3-none-any.whl and b/dist/app-1.0.0-py3-none-any.whl differ diff --git a/dist/app-1.0.0.tar.gz b/dist/app-1.0.0.tar.gz index dbaf721..a12a108 100644 Binary files a/dist/app-1.0.0.tar.gz and b/dist/app-1.0.0.tar.gz differ diff --git a/src/app/app.py b/src/app/app.py index 71d4789..0efe743 100644 --- a/src/app/app.py +++ b/src/app/app.py @@ -1,8 +1,9 @@ +import argparse import base64 import json import time import uuid -import argparse + import dataset from aiohttp import web @@ -243,58 +244,49 @@ class Application(WebDbApplication): content_type="application/json", ) - + argument_parser = argparse.ArgumentParser("Web service") argument_parser.add_argument( - "--host", - default="0.0.0.0", - required=False, - type=str, - help="Host to serve on." + "--host", default="0.0.0.0", required=False, type=str, help="Host to serve on." ) argument_parser.add_argument( - "--port", - default=8888, - required=False, - type=int, - help="Port to serve on." + "--port", default=8888, required=False, type=int, help="Port to serve on." ) argument_parser.add_argument( "--db-path", default="sqlite:///:memory:", required=False, type=str, - help="SQLAlchemy db url. (e.g. sqlite:///app.db)" + help="SQLAlchemy db url. (e.g. sqlite:///app.db)", ) argument_parser.add_argument( "--basic-username", default=None, required=False, type=str, - help="Basic Auth username." + help="Basic Auth username.", ) argument_parser.add_argument( "--basic-password", default=None, required=False, type=str, - help="Basic Auth password." + help="Basic Auth password.", ) argument_parser.add_argument( - "--db-web", - action="store_true", - help="Enable /db/* endpoints", - default=False + "--db-web", action="store_true", help="Enable /db/* endpoints", default=False ) - - - def create_app(*args, **kwargs): global argument_parser args = argument_parser.parse_args() - app = create_app(db_path=args.db_path,db_web=args.db_web,basic_username=args.basic_username,basic_password=args.basic_password) + app = create_app( + db_path=args.db_path, + db_web=args.db_web, + basic_username=args.basic_username, + basic_password=args.basic_password, + ) return app