python-gallery/run.py

44 lines
1.3 KiB
Python
Raw Normal View History

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-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-23 22:22:52 +00:00
Configuration()
2023-03-11 23:16:27 +00:00
if DEBUG:
2023-08-04 17:34:08 +00:00
from onlylegs.app import app
2023-04-07 12:35:30 +00:00
2023-08-04 17:34:08 +00:00
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
import sys
2023-04-05 16:57:07 +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
options = {
2023-04-07 12:35:30 +00:00
"bind": f"{ADDRESS}:{PORT}",
"workers": WORKERS,
}
2023-03-20 17:19:42 +00:00
OnlyLegs(options).run()