From d49e5b1f6ac44d40bf09fe03760af8b01b150c12 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 22 Jul 2023 15:11:58 +0200 Subject: [PATCH] Expose `Config.workdir` property. This is a useful proxy to avoid using `Config.get('workdir')` string lookup. --- platypush/config/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platypush/config/__init__.py b/platypush/config/__init__.py index bff1d3d66e..f109751c80 100644 --- a/platypush/config/__init__.py +++ b/platypush/config/__init__.py @@ -460,6 +460,16 @@ class Config: """ return cls._get_instance(cfgfile, force_reload=True) + @classmethod + @property + def workdir(cls) -> str: + """ + :return: The path of the configured working directory. + """ + workdir = cls._get_instance().get('workdir') + assert workdir + return workdir # type: ignore + @classmethod def get(cls, key: Optional[str] = None): """