From 0aaa90c27a440c555602e001150c2a6e5eeefed8 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Thu, 21 Dec 2023 19:13:29 +0000 Subject: [PATCH] Move location of config and cache --- build.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.py b/build.py index 9db178e..cff086d 100755 --- a/build.py +++ b/build.py @@ -14,8 +14,12 @@ import pytz import requests config = configparser.ConfigParser() -config.read("config") +config_file_path = os.path.expanduser( + os.path.join(os.getenv("XDG_CONFIG_HOME", "~/.config"), "bug-chart", "config") +) +assert os.path.exists(config_file_path) +config.read(os.path.expanduser(config_file_path)) Bug = dict[str, typing.Any] CallParams = dict[str, str | int] @@ -48,7 +52,7 @@ def download_bugs(state: str) -> list[Bug]: def get_all_bugs() -> list[Bug]: """Get all bugs.""" - filename = "all_bugs.json" + filename = config.get("output", "cache") if os.path.exists(filename): with open(filename) as fh: return typing.cast(list[Bug], json.load(fh))