This commit is contained in:
parent
86d4f8f1d3
commit
983969ed9e
BIN
dist/Zhurnal-1.4.37-py3-none-any.whl
vendored
BIN
dist/Zhurnal-1.4.37-py3-none-any.whl
vendored
Binary file not shown.
BIN
dist/zhurnal-1.3.37.tar.gz
vendored
BIN
dist/zhurnal-1.3.37.tar.gz
vendored
Binary file not shown.
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -1 +1,2 @@
|
|||||||
aiohttp
|
aiohttp
|
||||||
|
app@ git+https://molodetz.nl/retoor/app.git
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user