From ca2f10507c71020eab124d4f22231faca9934214 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Thu, 17 Nov 2022 01:29:16 +0100 Subject: Add MacOS to paths.py and update README --- README.md | 8 ++++---- muddle/paths.py | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4186964..0b8ed74 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,13 @@ A desktop Moodle client, because the web interface is painfully slow if you quic ## Configuration -On linux, copy `muddle.ini.sample` to `~/.config/muddle/muddle.ini` and add a token. -On other platforms there is no specific path implemented yet, so it will look for a file `muddle.ini` in the same folder as the executable. +On Linux, copy `doc/muddle.ini.example` to `~/.config/muddle/muddle.ini` and add a token; on Windows the file should be put in `%APPDATA%\muddle`; and on MacOS in `~/Library/ch.0hm.muddle`. +On other platforms for which there is no specific path implemented yet, so it will look for a file `muddle.ini` in the same folder as the executable. ## Development This is written in Python 3 + PyQt and the dependencies are managed with [Poetry](https://python-poetry.org/docs/#installation). -The code is a bit garbage, as I hacked it toghether in one morning, though I've tried to clean it up a bit. +The code is a bit garbage, as I hacked it together in one morning, though I've tried to clean it up a bit. ### Linux / MacOS Check that you have Python >= 3.5, install @@ -39,7 +39,7 @@ PS> poetry run python muddle --gui ### Coding style Use pycodestyle (PEP8) except where Qt bindings are used (`gui.py`). To check use ``` -$ poetry run pycodestyle --show-source --ignore=E501 muddle/__main__.py muddle/moodle.py +$ poetry run pycodestyle --show-source --ignore=E501 muddle/__main__.py muddle/moodle.py muddle/paths.py ``` ### Compilation / Release diff --git a/muddle/paths.py b/muddle/paths.py index 1448586..116d128 100644 --- a/muddle/paths.py +++ b/muddle/paths.py @@ -26,7 +26,10 @@ elif platform.system() == "Windows": if os.environ.get("LOCALAPPDATA"): default_log_dir = pathlib.Path(os.environ["LOCALAPPDATA"]).joinpath("muddle") -# TODO: implement for MacOS +elif platform.system() == "Darwin": + default_config_dir = pathlib.Path("~/Library/Preferences/ch.0hm.muddle/").expanduser() + default_log_dir = pathlib.Path("~/Library/Caches/ch.0hm.muddle/").expanduser() + default_config_file = default_config_dir.joinpath("muddle.ini") -default_log_file = default_log_dir.joinpath("muddle.log") \ No newline at end of file +default_log_file = default_log_dir.joinpath("muddle.log") -- cgit v1.2.1