From 357d4b8afded4e3f7982953b11eee7f347632af6 Mon Sep 17 00:00:00 2001 From: Shankari Date: Mon, 12 Aug 2024 08:45:34 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Remove=20the=20copied=20over=20c?= =?UTF-8?q?onfig=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we now use the standard backwards compat module (a0f0c6a66524c18733ae8239203701b3ce21cd98) --- emission/net/ext_service/push/config.py | 37 ------------------------- 1 file changed, 37 deletions(-) delete mode 100644 emission/net/ext_service/push/config.py diff --git a/emission/net/ext_service/push/config.py b/emission/net/ext_service/push/config.py deleted file mode 100644 index 1dabb75f0..000000000 --- a/emission/net/ext_service/push/config.py +++ /dev/null @@ -1,37 +0,0 @@ -import json -import logging -import os - -def get_config_data_from_env(): - config_data_env = { - "provider": os.getenv("PUSH_PROVIDER"), - "server_auth_token": os.getenv("PUSH_SERVER_AUTH_TOKEN"), - "app_package_name": os.getenv("PUSH_APP_PACKAGE_NAME"), - "ios_token_format": os.getenv("PUSH_IOS_TOKEN_FORMAT") - } - return config_data_env - -def get_config_data(): - try: - config_file = open('conf/net/ext_service/push.json') - ret_val = json.load(config_file) - config_file.close() - except: - logging.warning("net.ext_service.push.json not configured, checking environment variables...") - ret_val = get_config_data_from_env() - # Check if all PUSH environment variables are not set - if (not any(ret_val.values())): - raise TypeError - return ret_val - -try: - config_data = get_config_data() -except: - logging.warning("All push environment variables are set to None") - -def get_config(): - return config_data - -def reload_config(): - global config_data - config_data = get_config_data()