From 2601d4a2e49e27a4f9b597e7e9b2bb3fce5869ae Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Fri, 24 Dec 2021 02:21:58 +0000 Subject: [PATCH] Implement configuration parser --- .gitignore | 3 ++- handler/settings.py | 7 +++++++ handler/settings.sample.py | 14 -------------- 3 files changed, 9 insertions(+), 15 deletions(-) create mode 100644 handler/settings.py delete mode 100644 handler/settings.sample.py diff --git a/.gitignore b/.gitignore index f5f657d..4dacda6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ __pycache__/ env/ keys/ -handler/settings.py +handler/settings.ini + diff --git a/handler/settings.py b/handler/settings.py new file mode 100644 index 0000000..3a1ad52 --- /dev/null +++ b/handler/settings.py @@ -0,0 +1,7 @@ +# Other library imports +from ConfigObject import ConfigObject + +revolut_token = "" + +settings = ConfigObject() +settings.read("settings.ini") diff --git a/handler/settings.sample.py b/handler/settings.sample.py deleted file mode 100644 index c5512ae..0000000 --- a/handler/settings.sample.py +++ /dev/null @@ -1,14 +0,0 @@ -from types import SimpleNamespace - -pre_settings = { - "token_refresh_sec": 100, - "api_base": "https://sandbox-b2b.revolut.com/api/1.0", - "webhook_url": "https://callback-sandbox.pathogen.is/callback", - "redis_socket": "/var/run/redis/redis.sock", - "refresh_token": "", - "access_token": "", - "client_id": "", - "jwt": "", -} - -settings = SimpleNamespace(**pre_settings)