Read data dir from config.
This commit is contained in:
parent
147d84c793
commit
0f8951c979
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ __pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
__pycache__
|
__pycache__
|
||||||
.mypy_cache
|
.mypy_cache
|
||||||
|
config
|
||||||
|
|
|
@ -52,16 +52,16 @@ now = datetime.now()
|
||||||
today = now.date()
|
today = now.date()
|
||||||
now_str = now.strftime("%Y-%m-%d_%H:%M")
|
now_str = now.strftime("%Y-%m-%d_%H:%M")
|
||||||
now_utc = datetime.now(timezone.utc)
|
now_utc = datetime.now(timezone.utc)
|
||||||
data_dir = "/home/edward/lib/data"
|
|
||||||
do_refresh = len(sys.argv) > 1 and sys.argv[1] == "--refresh"
|
do_refresh = len(sys.argv) > 1 and sys.argv[1] == "--refresh"
|
||||||
|
|
||||||
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 = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(os.path.join(os.path.dirname(__file__), "config"))
|
config.read(os.path.join(os.path.dirname(__file__), "..", "config"))
|
||||||
|
|
||||||
access_key = config.get("exchangerate", "access_key")
|
access_key = config.get("exchangerate", "access_key")
|
||||||
|
data_dir = config.get("data", "dir")
|
||||||
|
|
||||||
|
|
||||||
def get_next_timezone_transition(tz_name: str) -> datetime:
|
def get_next_timezone_transition(tz_name: str) -> datetime:
|
||||||
|
|
Loading…
Reference in a new issue