Replaced Config.workdir with Config.get_workdir().

Again, Python < 3.9 doesn't like class properties.
This commit is contained in:
Fabio Manganiello 2023-08-19 13:21:24 +02:00
parent a8836f95f5
commit 1825b492b3
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
3 changed files with 3 additions and 4 deletions

View file

@ -498,8 +498,7 @@ class Config:
return cfg return cfg
@classmethod @classmethod
@property def get_workdir(cls) -> str:
def workdir(cls) -> str:
""" """
:return: The path of the configured working directory. :return: The path of the configured working directory.
""" """

View file

@ -117,7 +117,7 @@ class XmppPlugin(AsyncRunnablePlugin, XmppBasePlugin):
auto_accept_invites=auto_accept_invites, auto_accept_invites=auto_accept_invites,
restore_state=restore_state, restore_state=restore_state,
state_file=os.path.expanduser( 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() self._loaded_state = SerializedState()

View file

@ -523,7 +523,7 @@ def get_or_generate_jwt_rsa_key_pair():
""" """
from platypush.config import Config 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') priv_key_file = os.path.join(key_dir, 'id_rsa')
pub_key_file = priv_key_file + '.pub' pub_key_file = priv_key_file + '.pub'