From 1825b492b32cdc247aadf2b00db170d52878e760 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 19 Aug 2023 13:21:24 +0200 Subject: [PATCH] Replaced `Config.workdir` with `Config.get_workdir()`. Again, Python < 3.9 doesn't like class properties. --- platypush/config/__init__.py | 3 +-- platypush/plugins/xmpp/__init__.py | 2 +- platypush/utils/__init__.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/platypush/config/__init__.py b/platypush/config/__init__.py index 67541f176..d2de1fdef 100644 --- a/platypush/config/__init__.py +++ b/platypush/config/__init__.py @@ -498,8 +498,7 @@ class Config: return cfg @classmethod - @property - def workdir(cls) -> str: + def get_workdir(cls) -> str: """ :return: The path of the configured working directory. """ diff --git a/platypush/plugins/xmpp/__init__.py b/platypush/plugins/xmpp/__init__.py index 2d8ecc9de..a7de00766 100644 --- a/platypush/plugins/xmpp/__init__.py +++ b/platypush/plugins/xmpp/__init__.py @@ -117,7 +117,7 @@ class XmppPlugin(AsyncRunnablePlugin, XmppBasePlugin): auto_accept_invites=auto_accept_invites, restore_state=restore_state, state_file=os.path.expanduser( - state_file or os.path.join(Config.workdir, 'xmpp', 'state.json') + state_file or os.path.join(Config.get_workdir(), 'xmpp', 'state.json') ), ) self._loaded_state = SerializedState() diff --git a/platypush/utils/__init__.py b/platypush/utils/__init__.py index 20763fc90..7f16cce82 100644 --- a/platypush/utils/__init__.py +++ b/platypush/utils/__init__.py @@ -523,7 +523,7 @@ def get_or_generate_jwt_rsa_key_pair(): """ from platypush.config import Config - key_dir = os.path.join(Config.workdir, 'jwt') + key_dir = os.path.join(Config.get_workdir(), 'jwt') priv_key_file = os.path.join(key_dir, 'id_rsa') pub_key_file = priv_key_file + '.pub'