python-gallery/run.py

46 lines
1.3 KiB
Python
Raw Normal View History

2023-03-20 17:19:42 +00:00
"""
Run script for OnlyLegs
"""
from setup.args import PORT, ADDRESS, WORKERS, DEBUG
from setup.configuration import Configuration
2023-03-11 23:16:27 +00:00
print("""
:::::::: :::: ::: ::: ::: ::: ::: ::::::::: ::::::::: ::::::::
:+: :+: :+:+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#+ +:+ +#+ +:+ +#+ +#+ +#++: +#+ +#++:++# :#: +#++:++#++
+#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ +#+ +#+# +#+
#+# #+# #+# #+#+# #+# #+# #+# #+# #+# #+# #+# #+#
######## ### #### ########## ### ########## ######### ######### ########
2023-04-02 17:40:45 +00:00
Created by Fluffy Bean - Version 23.04.02
2023-03-11 23:16:27 +00:00
""")
2023-03-23 22:22:52 +00:00
# Run pre-startup checks and load configuration
Configuration()
2023-03-11 23:16:27 +00:00
if DEBUG:
2023-03-11 23:16:27 +00:00
from gallery import create_app
# If no address is specified, use localhost
if not ADDRESS:
ADDRESS = 'localhost'
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
# If no address is specified, bind the server to all interfaces
if not ADDRESS:
ADDRESS = '0.0.0.0'
2023-03-20 17:19:42 +00:00
options = {
'bind': f'{ADDRESS}:{PORT}',
'workers': WORKERS,
}
2023-03-20 17:19:42 +00:00
OnlyLegs(options).run()