Assert config file exists.
This commit is contained in:
parent
a17f97e953
commit
c6861c7d51
|
@ -37,8 +37,12 @@ now_utc = datetime.now(timezone.utc)
|
||||||
next_us_presidential_election = date(2024, 11, 5)
|
next_us_presidential_election = date(2024, 11, 5)
|
||||||
next_uk_general_election = date(2024, 5, 2)
|
next_uk_general_election = date(2024, 5, 2)
|
||||||
|
|
||||||
|
config_filename = os.path.join(os.path.dirname(__file__), "..", "config")
|
||||||
|
|
||||||
|
assert os.path.exists(config_filename)
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(os.path.join(os.path.dirname(__file__), "..", "config"))
|
config.read(config_filename)
|
||||||
|
|
||||||
access_key = config.get("exchangerate", "access_key")
|
access_key = config.get("exchangerate", "access_key")
|
||||||
data_dir = config.get("data", "dir")
|
data_dir = config.get("data", "dir")
|
||||||
|
|
Loading…
Reference in a new issue