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-03-26 01:04:13 +00:00
|
|
|
:::::::: :::: ::: ::: ::: ::: ::: ::::::::: ::::::::: ::::::::
|
|
|
|
:+: :+: :+:+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
|
|
|
|
+:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
|
|
|
|
+#+ +:+ +#+ +:+ +#+ +#+ +#++: +#+ +#++:++# :#: +#++:++#++
|
|
|
|
+#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ +#+ +#+# +#+
|
|
|
|
#+# #+# #+# #+#+# #+# #+# #+# #+# #+# #+# #+# #+#
|
|
|
|
######## ### #### ########## ### ########## ######### ######### ########
|
2023-04-01 18:25:14 +00:00
|
|
|
|
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-12 13:12:38 +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
|
|
|
|
|
|
|
|
2023-03-12 12:29:29 +00:00
|
|
|
if DEBUG:
|
2023-03-11 23:16:27 +00:00
|
|
|
from gallery import create_app
|
2023-03-20 17:04:05 +00:00
|
|
|
|
|
|
|
# If no address is specified, use localhost
|
|
|
|
if not ADDRESS:
|
|
|
|
ADDRESS = 'localhost'
|
|
|
|
|
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-03-20 17:04:05 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
2023-03-12 12:29:29 +00:00
|
|
|
options = {
|
|
|
|
'bind': f'{ADDRESS}:{PORT}',
|
|
|
|
'workers': WORKERS,
|
|
|
|
}
|
2023-03-20 17:19:42 +00:00
|
|
|
|
2023-03-12 12:29:29 +00:00
|
|
|
OnlyLegs(options).run()
|