Implement configuration parser

This commit is contained in:
Mark Veidemanis 2021-12-24 02:21:58 +00:00
parent 0aa1b3d58d
commit 2601d4a2e4
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
3 changed files with 9 additions and 15 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@
__pycache__/
env/
keys/
handler/settings.py
handler/settings.ini

7
handler/settings.py Normal file
View File

@ -0,0 +1,7 @@
# Other library imports
from ConfigObject import ConfigObject
revolut_token = ""
settings = ConfigObject()
settings.read("settings.ini")

View File

@ -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)