diff --git a/dist/Zhurnal-1.4.37-py3-none-any.whl b/dist/Zhurnal-1.4.37-py3-none-any.whl deleted file mode 100644 index 6ae44a8..0000000 Binary files a/dist/Zhurnal-1.4.37-py3-none-any.whl and /dev/null differ diff --git a/dist/zhurnal-1.3.37.tar.gz b/dist/zhurnal-1.3.37.tar.gz deleted file mode 100644 index bc303b9..0000000 Binary files a/dist/zhurnal-1.3.37.tar.gz and /dev/null differ diff --git a/setup.cfg b/setup.cfg index 0d58825..040c49b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = Zhurnal +name = zhurnal version = 1.4.37 description = Web executor and logger author = retoor @@ -15,7 +15,8 @@ package_dir = python_requires = >=3.7 install_requires = aiohttp - + app @ git+https://molodetz.nl/retoor/app.git + [options.packages.find] where = src diff --git a/src/Zhurnal.egg-info/PKG-INFO b/src/Zhurnal.egg-info/PKG-INFO index 47e97dc..7b29970 100644 --- a/src/Zhurnal.egg-info/PKG-INFO +++ b/src/Zhurnal.egg-info/PKG-INFO @@ -8,6 +8,7 @@ License: MIT Requires-Python: >=3.7 Description-Content-Type: text/markdown Requires-Dist: aiohttp +Requires-Dist: app@ git+https://molodetz.nl/retoor/app.git # Zhurnal diff --git a/src/Zhurnal.egg-info/requires.txt b/src/Zhurnal.egg-info/requires.txt index ee4ba4f..b290cb7 100644 --- a/src/Zhurnal.egg-info/requires.txt +++ b/src/Zhurnal.egg-info/requires.txt @@ -1 +1,2 @@ aiohttp +app@ git+https://molodetz.nl/retoor/app.git diff --git a/src/zhurnal/app.py b/src/zhurnal/app.py index 801ac8d..ce60390 100644 --- a/src/zhurnal/app.py +++ b/src/zhurnal/app.py @@ -4,7 +4,7 @@ import shlex import time from datetime import datetime from typing import List - +from app.app import Application as BaseApplication from aiohttp import web from zhurnal import log @@ -199,7 +199,7 @@ let scrollTop = window.scrollY; // Current scroll position """ -class Zhurnal(web.Application): +class Zhurnal(BaseApplication): def __init__(self, commands: List[str], *args, **kwargs): self.commands = commands or [] @@ -307,18 +307,34 @@ def parse_args(): "--host", type=str, default="localhost", + required=False, help="Hostname or IP address (default: localhost).", ) parser.add_argument( - "--port", type=int, default=8080, help="Port number (default: 8080)." + "--port", + type=int, + default=0, + required=False, + help="Port number (default: 8080).", + ) + parser.add_argument( + "--username", type=str, default=None, help="Username if auth is required." + ) + parser.add_argument( + "--password", type=str, default=None, help="Password if auth is required." ) return parser.parse_args() def cli(): args = parse_args() - app = Zhurnal(commands=args.commands) + app = Zhurnal( + commands=args.commands, + basic_username=args.username, + basic_password=args.password, + ) for command in args.commands: log.info(f"Preparing execution of {command}.") log.info(f"Host: {args.host} Port: {args.port}") - web.run_app(app, host=args.host, port=args.port) + + app.run(host=args.host, port=args.port)