Improved application environment
This commit is contained in:
parent
76a6ba11fb
commit
dc849c4f71
@ -81,18 +81,22 @@ class ApplicationEnvironment(ApplicationEnvironmentABC):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def working_directory(self) -> str:
|
def working_directory(self) -> str:
|
||||||
return self._working_directory
|
return str(self._working_directory)
|
||||||
|
|
||||||
def set_working_directory(self, path: str = ''):
|
|
||||||
if path != '':
|
|
||||||
self._working_directory = path
|
|
||||||
return
|
|
||||||
|
|
||||||
self._working_directory = pathlib.Path().absolute()
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def runtime_directory(self) -> str:
|
def runtime_directory(self) -> str:
|
||||||
return self._runtime_directory
|
return str(self._runtime_directory)
|
||||||
|
|
||||||
def set_runtime_directory(self, file: str):
|
def set_runtime_directory(self, runtime_directory: str):
|
||||||
self._runtime_directory = pathlib.Path(file).parent.absolute()
|
if runtime_directory != '':
|
||||||
|
self._runtime_directory = runtime_directory
|
||||||
|
return
|
||||||
|
|
||||||
|
self._runtime_directory = pathlib.Path().absolute()
|
||||||
|
|
||||||
|
def set_working_directory(self, working_directory: str):
|
||||||
|
if working_directory != '':
|
||||||
|
self._working_directory = working_directory
|
||||||
|
return
|
||||||
|
|
||||||
|
self._working_directory = pathlib.Path().absolute()
|
||||||
|
@ -83,3 +83,12 @@ class ApplicationEnvironmentABC(ABC):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def set_working_directory(self, working_directory: str):
|
||||||
|
"""
|
||||||
|
Sets the current working directory
|
||||||
|
:param working_directory:
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user