From 395135fcebae0a2bca476b058f78f9e1ad8b13ee Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Fri, 7 May 2021 13:00:12 +0300 Subject: utility: startup_config: Remove dead comments --- wqflask/utility/startup_config.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'wqflask/utility/startup_config.py') diff --git a/wqflask/utility/startup_config.py b/wqflask/utility/startup_config.py index 6ef759e0..07322a62 100644 --- a/wqflask/utility/startup_config.py +++ b/wqflask/utility/startup_config.py @@ -16,12 +16,10 @@ def app_config(): if not app.config.get('SECRET_KEY'): import os app.config['SECRET_KEY'] = str(os.urandom(24)) - mode = WEBSERVER_MODE if mode == "DEV" or mode == "DEBUG": app.config['TEMPLATES_AUTO_RELOAD'] = True - # if mode == "DEBUG": - # app.config['EXPLAIN_TEMPLATE_LOADING'] = True <--- use overriding app param instead + print("==========================================") show_settings() @@ -34,9 +32,5 @@ def app_config(): page = requests.get(get_setting("GN_SERVER_URL")) if page.status_code != 200: raise Exception("API server not found!") - - # import utility.elasticsearch_tools as es - # es.test_elasticsearch_connection() - print(("GN2 is running. Visit %s[http://localhost:%s/%s](%s)" % (BLUE, str(port), ENDC, get_setting("WEBSERVER_URL")))) -- cgit v1.2.3 From 74befd19d3d24a89d7d382625648ddade74099f7 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Fri, 7 May 2021 13:06:06 +0300 Subject: utility: startup_config: Break up long import statement --- wqflask/utility/startup_config.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'wqflask/utility/startup_config.py') diff --git a/wqflask/utility/startup_config.py b/wqflask/utility/startup_config.py index 07322a62..d705a0ff 100644 --- a/wqflask/utility/startup_config.py +++ b/wqflask/utility/startup_config.py @@ -1,9 +1,12 @@ from wqflask import app -from utility.tools import WEBSERVER_MODE, show_settings, get_setting_int, get_setting, get_setting_bool -import utility.logger -logger = utility.logger.getLogger(__name__) +from utility.tools import WEBSERVER_MODE +from utility.tools import show_settings +from utility.tools import get_setting_int +from utility.tools import get_setting +from utility.tools import get_setting_bool + BLUE = '\033[94m' GREEN = '\033[92m' -- cgit v1.2.3 From 809351ae0021f48b8a138212764aab4396f564ef Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Fri, 7 May 2021 13:06:31 +0300 Subject: utility: startup_config: Use python3 f-strings --- wqflask/utility/startup_config.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'wqflask/utility/startup_config.py') diff --git a/wqflask/utility/startup_config.py b/wqflask/utility/startup_config.py index d705a0ff..56d0af6f 100644 --- a/wqflask/utility/startup_config.py +++ b/wqflask/utility/startup_config.py @@ -24,16 +24,17 @@ def app_config(): app.config['TEMPLATES_AUTO_RELOAD'] = True print("==========================================") + show_settings() port = get_setting_int("SERVER_PORT") if get_setting_bool("USE_GN_SERVER"): - print( - ("GN2 API server URL is [" + BLUE + get_setting("GN_SERVER_URL") + ENDC + "]")) + print(f"GN2 API server URL is [{BLUE}GN_SERVER_URL{ENDC}]") import requests page = requests.get(get_setting("GN_SERVER_URL")) if page.status_code != 200: raise Exception("API server not found!") - print(("GN2 is running. Visit %s[http://localhost:%s/%s](%s)" % - (BLUE, str(port), ENDC, get_setting("WEBSERVER_URL")))) + print(f"GN2 is running. Visit {BLUE}" + f"[http://localhost:{str(port)}/{ENDC}]" + f"({get_setting('WEBSERVER_URL')})") -- cgit v1.2.3