Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 4 additions & 5 deletions utils/emulator_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def wrapper(msg: str) -> str | None:

if msg is None:
msg = (
"Expected function '{}' to evaluate to True " "when reading emulator property '{}'."
"Expected function '{}' to evaluate to True when reading emulator property '{}'."
).format(func.__name__, emulator_property)

err = self._wait_for_emulator_lambda(partial(wrapper, msg), timeout)
Expand Down Expand Up @@ -400,8 +400,7 @@ def wrapper(msg: str) -> str | None:

if msg is None:
msg = (
"Expected function '{}' to evaluate to False "
"when reading emulator property '{}'."
"Expected function '{}' to evaluate to False when reading emulator property '{}'."
).format(func.__name__, emulator_property)

err = self._wait_for_emulator_lambda(partial(wrapper, msg), timeout)
Expand Down Expand Up @@ -628,7 +627,7 @@ def _open(self) -> None:
:param port: the port on which to run lewis
:return:
"""
self._logFile = open(self._log_filename(), "w")
self._logFile = open(self._log_filename(), "a")
self._control_port = str(get_free_ports(1)[0])
lewis_command_line = [
self._python_path,
Expand Down Expand Up @@ -960,7 +959,7 @@ def _open(self) -> None:
log_filename(
self._test_name, "cmdemulator", self._device, TestModes.RECSIM, self._var_dir
),
"w",
"a",
)
self._call_command_line(self.command_line.format(port=self._port))

Expand Down
2 changes: 1 addition & 1 deletion utils/ioc_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def open(self) -> None:

self.create_macros_file()

self.log_file_manager = LogFileManager(self.log_file_name)
self.log_file_manager = LogFileManager(self.log_file_name, "a")
self.log_file_manager.log_file_w.write(
"Started IOC with '{0}'".format(" ".join(self.command_line))
)
Expand Down
4 changes: 2 additions & 2 deletions utils/log_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class LogFileManager(object):
Class to manage the access of log files
"""

def __init__(self, filename: str) -> None:
self.log_file_w = open(filename, "w", 1)
def __init__(self, filename: str, write_mode: str = "w") -> None:
self.log_file_w = open(filename, write_mode, 1)
self.log_file_r = open(filename, "r")

def read_log(self) -> list[str]:
Expand Down
Loading