yacscript 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
app/__init__.py ADDED
@@ -0,0 +1,24 @@
1
+ from .app import app, socketio, initialization
2
+ from os.path import isfile
3
+ import click
4
+
5
+ @click.command
6
+ @click.option('-c', '--config', default=None, help='Path to the config file.')
7
+ def main(config):
8
+ '''Entry point for YACS.'''
9
+ if config is not None:
10
+ if not isfile(config):
11
+ click.echo('Config file does not exist!', err=True)
12
+ return 0
13
+ result = initialization(config)
14
+ if result != 'ok':
15
+ click.echo(f'Initialization failed while parsing config file: {result}')
16
+ return 0
17
+ app.logger.info(f'YACS is now running on http://{app.config["app"]["ip"]}:{app.config["app"]["port"]}{' with DEBUG MODE ON' if app.config['DEBUG'] else ''}.')
18
+ app.logger.info(f'You have set the guest passphrase to "{app.config['app']['user_phrase']}" , and the admin passphrase to "{app.config['app']['admin_phrase']}"')
19
+ socketio.run(
20
+ app,
21
+ host=app.config["app"]["ip"],
22
+ port=app.config["app"]["port"],
23
+ debug=app.config["DEBUG"],
24
+ )