Skip to content

Commit

Permalink
detector chngd
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-usielski committed Nov 12, 2024
1 parent d3d281d commit dbe5472
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions moler/config/loggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
%% %%% %%% %% %%% %% %%% %%%%%%%%% %%% %%%%%%%
%% %%%%% %% %%% %% %%% %%% %%% %%%
%% %%% %% %%%%%%%%%%% %%%%%%%%% %%%%%%%%%% %%% %%%
Prompt detecting v1.
"""


Expand Down
3 changes: 2 additions & 1 deletion moler/device/proxy_pc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def on_connection_lost(self, connection):
self._set_state(NOT_CONNECTED)

def _detect_after_open_prompt(self, set_callback):
print("Detecting prompt")
self._prompt_detected = False
self._after_open_prompt_detector = Wait4(
detect_patterns=[rf'^(.+){self._detecting_prompt_cmd}'],
Expand Down Expand Up @@ -454,7 +455,7 @@ def get_cmd(self, cmd_name, cmd_params=None, check_state=True, for_state=None):

def _detect_prompt_get_cmd(self):
self.logger.debug("get_cmd was called but prompt has not been detected yet.")
if self._after_open_prompt_detector is None or self._after_open_prompt_detector.running() is False:
if self._after_open_prompt_detector is None or not self._after_open_prompt_detector.running():
self._detect_after_open_prompt(self._set_after_open_prompt)
self._after_open_prompt_detector.await_done(timeout=self._prompt_detector_timeout)

Expand Down

0 comments on commit dbe5472

Please sign in to comment.