Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions OMPython/OMCSession.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,12 +809,20 @@ def __init__(

# store variables
self._timeout = timeout
# command prefix (to be used for docker or WSL)
self._cmd_prefix: list[str] = []

def __post_init__(self) -> None:
"""
Post initialisation method.
"""

def get_cmd_prefix(self) -> list[str]:
"""
Get session definition used for this instance of OMPath.
"""
return self._cmd_prefix.copy()

@staticmethod
def escape_str(value: str) -> str:
"""
Expand Down Expand Up @@ -843,7 +851,7 @@ def set_workdir(self, workdir: OMPathABC) -> None:
@abc.abstractmethod
def omcpath(self, *path) -> OMPathABC:
"""
Create an OMPathBase object based on the given path segments and the current class.
Create an OMPathABC object based on the given path segments and the current class.
"""

@abc.abstractmethod
Expand Down Expand Up @@ -907,13 +915,12 @@ def __init__(
"""
Initialisation for OMCSession
"""
super().__init__(timeout=timeout)

# some helper data
self.model_execution_windows = platform.system() == "Windows"
self.model_execution_local = False

# store variables
self._timeout = timeout
# generate a random string for this instance of OMC
self._random_string = uuid.uuid4().hex
# get a temporary directory
Expand Down Expand Up @@ -990,6 +997,7 @@ def __del__(self):
self._omc_process.kill()
self._omc_process.wait()
finally:

self._omc_process = None

def _timeout_loop(
Expand Down
Loading