Added _str properties for config Path variables

This commit is contained in:
A_D authored and Athanasius committed 2021-04-01 14:45:48 +01:00
1 parent 2319cbf404
commit 41f7391e42
1 file changed
+30
+30
View File
@@ -119,6 +119,36 @@ class AbstractConfig(abc.ABC):
def __init__(self) -> None:
self.home = pathlib.Path.home()
@property
def app_dir_str(self) -> str:
"""Return a string version of app_dir."""
return str(self.app_dir)
@property
def plugin_dir_str(self) -> str:
"""Return a string version of plugin_dir."""
return str(self.plugin_dir)
@property
def internal_plugin_dir_str(self) -> str:
"""Return a string version of internal_plugin_dir."""
return str(self.internal_plugin_dir)
@property
def respath_str(self) -> str:
"""Return a string version of respath."""
return str(self.respath)
@property
def home_str(self) -> str:
"""Return a string version of home."""
return str(self.home)
@property
def default_journal_dir_str(self) -> str:
"""Return a string version of default_journal_dir."""
return str(self.default_journal_dir)
@staticmethod
def _suppress_call(
func: Callable[..., _T], exceptions: Union[Type[BaseException], List[Type[BaseException]]] = Exception,