diff options
author | ComradeCrow <comradecrow@vivaldi.net> | 2025-02-18 16:13:05 -0800 |
---|---|---|
committer | ComradeCrow <comradecrow@tilde.institute> | 2025-02-19 00:34:28 +0000 |
commit | 231d2c44fbadc797ca5bb0a6237a566561b8497f (patch) | |
tree | 3b0d38dd9b652e537a80052d01f3f75e4441165c | |
parent | 4d71ed8e8dbd794e8e22baec590e23fba6a347ed (diff) | |
download | podweb-231d2c44fbadc797ca5bb0a6237a566561b8497f.tar.gz |
basic windows support
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | PodWeb.py | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore index 95ca0ac..e7c06d4 100644 --- a/.gitignore +++ b/.gitignore @@ -115,6 +115,7 @@ celerybeat.pid # Environments .env .venv +.wenv env/ venv/ ENV/ diff --git a/PodWeb.py b/PodWeb.py index 9123348..e9c9a49 100755 --- a/PodWeb.py +++ b/PodWeb.py @@ -20,9 +20,12 @@ options = { "serverlist": os.path.normpath( os.path.join(os.path.expanduser("~/.config/podweb"), "serverlist") ), - "downloadlocation": os.path.expanduser("~/Podcasts"), + "downloadlocation": os.path.expanduser("~/Podcasts") } +if os.name == "nt": + options.update({"serverlist": os.path.join(os.getenv('LOCALAPPDATA'), "podweb", "serverlist")}) + yaml = YAML() yaml.allow_duplicate_keys = True @@ -79,9 +82,13 @@ class PodWeb: self.config_path, "podcasts" ) else: - self.config_path = os.path.normpath(os.path.expanduser("~/.config/podweb")) + if os.name == "nt": + self.config_path = os.path.join(os.getenv('LOCALAPPDATA'), "podweb") + self.db_path = os.path.join(self.config_path, "data") + else: + self.config_path = os.path.normpath(os.path.expanduser("~/.config/podweb")) + self.db_path = os.path.expanduser("~/.local/share/podweb") self.config_filepath = os.path.join(self.config_path, "config.yaml") - self.db_path = os.path.expanduser("~/.local/share/podweb") self.db_filepath = os.path.join(self.db_path, "podweb.db") if config: self.config_filepath = os.path.normpath(os.path.expanduser(config)) |