From 0775677d5584e939f5b091f55add3bb58bcb4887 Mon Sep 17 00:00:00 2001 From: Giovanni Santini Date: Tue, 2 Apr 2024 18:51:11 +0200 Subject: [PATCH] fix: Small fixes identified when creating my pull requests - Sometimes, we create a message to pass to the DBus which cannot be pickled. The standard `.copy` works. - Update the version number. - Ensure we provide a string to the NotificationHandler when needed (e.g. an exception) --- yin_yang/NotificationHandler.py | 2 +- yin_yang/config.py | 2 +- yin_yang/plugins/_plugin.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yin_yang/NotificationHandler.py b/yin_yang/NotificationHandler.py index 6f5a397..1751a82 100644 --- a/yin_yang/NotificationHandler.py +++ b/yin_yang/NotificationHandler.py @@ -5,5 +5,5 @@ class NotificationHandler(Handler): """Shows logs as notifications""" def emit(self, record): - subprocess.call(['notify-send', record.levelname, record.msg, + subprocess.call(['notify-send', record.levelname, str(record.msg), '-a', 'Yin & Yang', '-u', 'low', '--icon', 'yin_yang']) diff --git a/yin_yang/config.py b/yin_yang/config.py index b0ca879..b70626c 100755 --- a/yin_yang/config.py +++ b/yin_yang/config.py @@ -326,7 +326,7 @@ def defaults(self) -> dict: # NOTE: if you change or add new values here, make sure to update the version number and update_config() method conf_default = { - 'version': 3.3, + 'version': 3.4, 'running': False, 'dark_mode': False, 'mode': Modes.MANUAL.value, diff --git a/yin_yang/plugins/_plugin.py b/yin_yang/plugins/_plugin.py index ddce089..1501c55 100644 --- a/yin_yang/plugins/_plugin.py +++ b/yin_yang/plugins/_plugin.py @@ -269,7 +269,7 @@ def set_theme(self, theme: str): self.call(self.create_message(theme)) def create_message(self, theme: str) -> QDBusMessage: - message = copy.deepcopy(self.base_message) + message = copy.copy(self.base_message) message.setArguments([theme]) return message