2023-03-20 17:19:42 +00:00
|
|
|
"""
|
|
|
|
Run script for OnlyLegs
|
|
|
|
"""
|
2023-04-20 17:38:44 +00:00
|
|
|
import importlib.metadata
|
2023-03-20 17:19:42 +00:00
|
|
|
from setup.args import PORT, ADDRESS, WORKERS, DEBUG
|
|
|
|
from setup.configuration import Configuration
|
|
|
|
|
|
|
|
|
2023-04-07 12:35:30 +00:00
|
|
|
print(
|
2023-04-20 17:38:44 +00:00
|
|
|
f"""
|
2023-03-26 01:04:13 +00:00
|
|
|
:::::::: :::: ::: ::: ::: ::: ::: ::::::::: ::::::::: ::::::::
|
|
|
|
:+: :+: :+:+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
|
|
|
|
+:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
|
|
|
|
+#+ +:+ +#+ +:+ +#+ +#+ +#++: +#+ +#++:++# :#: +#++:++#++
|
|
|
|
+#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ +#+ +#+# +#+
|
|
|
|
#+# #+# #+# #+#+# #+# #+# #+# #+# #+# #+# #+# #+#
|
|
|
|
######## ### #### ########## ### ########## ######### ######### ########
|
2023-04-01 18:25:14 +00:00
|
|
|
|
2023-04-20 17:38:44 +00:00
|
|
|
Created by Fluffy Bean - {importlib.metadata.version("OnlyLegs")}
|
2023-04-07 12:35:30 +00:00
|
|
|
"""
|
|
|
|
)
|
2023-03-11 23:16:27 +00:00
|
|
|
|
2023-03-12 13:12:38 +00:00
|
|
|
|
2023-03-23 22:22:52 +00:00
|
|
|
Configuration()
|
2023-03-11 23:16:27 +00:00
|
|
|
|
|
|
|
|
2023-03-12 12:29:29 +00:00
|
|
|
if DEBUG:
|
2023-04-12 16:58:13 +00:00
|
|
|
from onlylegs import create_app
|
2023-04-07 12:35:30 +00:00
|
|
|
|
2023-03-12 13:12:38 +00:00
|
|
|
create_app().run(host=ADDRESS, port=PORT, debug=True, threaded=True)
|
2023-03-11 23:16:27 +00:00
|
|
|
else:
|
2023-03-20 17:19:42 +00:00
|
|
|
from setup.runner import OnlyLegs # pylint: disable=C0412
|
2023-04-02 23:20:34 +00:00
|
|
|
import sys
|
2023-04-05 16:57:07 +00:00
|
|
|
|
2023-04-02 23:20:34 +00:00
|
|
|
# Stop Gunicorn from reading the command line arguments as it causes errors
|
|
|
|
sys.argv = [sys.argv[0]]
|
2023-04-05 16:57:07 +00:00
|
|
|
|
2023-03-12 12:29:29 +00:00
|
|
|
options = {
|
2023-04-07 12:35:30 +00:00
|
|
|
"bind": f"{ADDRESS}:{PORT}",
|
|
|
|
"workers": WORKERS,
|
2023-03-12 12:29:29 +00:00
|
|
|
}
|
2023-03-20 17:19:42 +00:00
|
|
|
|
2023-03-12 12:29:29 +00:00
|
|
|
OnlyLegs(options).run()
|