Update name.
Some checks are pending
Build and test Zhurnal / Test (push) Waiting to run

This commit is contained in:
retoor 2024-12-10 01:35:43 +01:00
parent 86d4f8f1d3
commit 983969ed9e
6 changed files with 26 additions and 7 deletions

Binary file not shown.

Binary file not shown.

View File

@ -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

View File

@ -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

View File

@ -1 +1,2 @@
aiohttp
app@ git+https://molodetz.nl/retoor/app.git

View File

@ -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)