From 74fa37d37fc6c68d5f39efb4ca4649999c15b0e9 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Thu, 24 Dec 2020 17:16:15 +0100 Subject: Add Windows path for config and log files --- muddle.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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") -- cgit v1.2.1