Expose `Config.workdir` property.

This is a useful proxy to avoid using `Config.get('workdir')` string
lookup.
This commit is contained in:
Fabio Manganiello 2023-07-22 15:11:58 +02:00
parent c846c61493
commit d49e5b1f6a
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 10 additions and 0 deletions

View File

@ -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):
"""