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] [metadata]
name = Zhurnal name = zhurnal
version = 1.4.37 version = 1.4.37
description = Web executor and logger description = Web executor and logger
author = retoor author = retoor
@ -15,7 +15,8 @@ package_dir =
python_requires = >=3.7 python_requires = >=3.7
install_requires = install_requires =
aiohttp aiohttp
app @ git+https://molodetz.nl/retoor/app.git
[options.packages.find] [options.packages.find]
where = src where = src

View File

@ -8,6 +8,7 @@ License: MIT
Requires-Python: >=3.7 Requires-Python: >=3.7
Description-Content-Type: text/markdown Description-Content-Type: text/markdown
Requires-Dist: aiohttp Requires-Dist: aiohttp
Requires-Dist: app@ git+https://molodetz.nl/retoor/app.git
# Zhurnal # Zhurnal

View File

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

View File

@ -4,7 +4,7 @@ import shlex
import time import time
from datetime import datetime from datetime import datetime
from typing import List from typing import List
from app.app import Application as BaseApplication
from aiohttp import web from aiohttp import web
from zhurnal import log 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): def __init__(self, commands: List[str], *args, **kwargs):
self.commands = commands or [] self.commands = commands or []
@ -307,18 +307,34 @@ def parse_args():
"--host", "--host",
type=str, type=str,
default="localhost", default="localhost",
required=False,
help="Hostname or IP address (default: localhost).", help="Hostname or IP address (default: localhost).",
) )
parser.add_argument( 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() return parser.parse_args()
def cli(): def cli():
args = parse_args() 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: for command in args.commands:
log.info(f"Preparing execution of {command}.") log.info(f"Preparing execution of {command}.")
log.info(f"Host: {args.host} Port: {args.port}") 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)