This is the implementation. It appends one or the other to the output of a command. They are defines as
REMOTE_CMD_FAIL = "ora-remote: end - fail"
REMOTE_CMD_OK = "ora-remote: end - ok"
Now the IO implementation is based on a loop over readline(). This means that if the preceding output has no final newline, the end marker will not be on its own line. However, this is the code for catching end marker
if line == self.REMOTE_CMD_OK + '\n':
...
elif line == self.REMOTE_CMD_FAIL + '\n':
It only ever considers markers that are on their own line.
One possibility would be to have markers that start with a newline. The while loop in _run() could then expect a marker on its own line. However, it would need to withhold that additional newline from the output, and also make sure that it does not mistake a regular newline for the start of an end marker that was not actually a complete one.
This is the implementation. It appends one or the other to the output of a command. They are defines as
Now the IO implementation is based on a loop over
readline()
. This means that if the preceding output has no final newline, the end marker will not be on its own line. However, this is the code for catching end markerIt only ever considers markers that are on their own line.
One possibility would be to have markers that start with a newline. The
while
loop in_run()
could then expect a marker on its own line. However, it would need to withhold that additional newline from the output, and also make sure that it does not mistake a regular newline for the start of an end marker that was not actually a complete one.