aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2020-12-24 17:16:15 +0100
committerNao Pross <np@0hm.ch>2020-12-24 17:16:15 +0100
commit74fa37d37fc6c68d5f39efb4ca4649999c15b0e9 (patch)
tree3bcf668b378482e996fdf142f17ca746085fde8d
parentFix typo in README (diff)
downloadMuddle-74fa37d37fc6c68d5f39efb4ca4649999c15b0e9.tar.gz
Muddle-74fa37d37fc6c68d5f39efb4ca4649999c15b0e9.zip
Add Windows path for config and log files
Diffstat (limited to '')
-rw-r--r--muddle.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/muddle.py b/muddle.py
index c7adbab..22f2396 100644
--- a/muddle.py
+++ b/muddle.py
@@ -72,8 +72,14 @@ if platform.system() == "Linux":
elif pathlib.Path("~/.cache").expanduser().exists():
default_log_dir = pathlib.Path("~/.cache/muddle/").expanduser()
+elif platform.system() == "Windows":
+ if os.environ.get("APPDATA"):
+ default_config_dir = pathlib.Path(os.environ["APPDATA"]).joinpath("muddle/")
-# TODO: implement for other platforms
+ if os.environ.get("LOCALAPPDATA"):
+ default_log_dir = pathlib.Path(os.environ["LOCALAPPDATA"]).joinpath("muddle")
+
+# TODO: implement for MacOS
default_config_file = default_config_dir.joinpath("muddle.ini")
default_log_file = default_log_dir.joinpath("muddle.log")