forked from evilalmus/arlo-downloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
39 lines (34 loc) · 849 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os
class Config:
__conf = {
"save_media_to": os.environ.get("SAVE_MEDIA_TO"),
"tfa_type": "PUSH",
"tfa_source": "push",
"tfa_retries": 10,
"tfa_delay": 5,
"tfa_host": "",
"tfa_username": "",
"tfa_password": "",
}
__setters = [
"set_logger",
"save_media_to",
"tfa_type",
"tfa_source",
"tfa_retries",
"tfa_delay",
"tfa_host",
"tfa_username",
"tfa_password",
]
@staticmethod
def config(name):
return Config.__conf[name]
def dump_config():
return Config.__conf
@staticmethod
def set(name, value):
if name in Config.__setters:
Config.__conf[name] = value
else:
raise NameError("Name not accepted in set() method")