Skip to content

Commit

Permalink
info -> debug
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-usielski committed Oct 11, 2023
1 parent cb1ed95 commit 293bd1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
15 changes: 7 additions & 8 deletions moler/device/proxy_pc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ def on_connection_lost(self, connection):
self._set_state(NOT_CONNECTED)

def _detect_after_open_prompt(self, set_callback):
self.logger.info("_detect_after_open_prompt !")
self._after_open_prompt_detector = Wait4(detect_patterns=[r'^(.+){}'.format(self._detecting_prompt_cmd)],
connection=self.io_connection.moler_connection,
till_occurs_times=1)
Expand All @@ -272,19 +271,19 @@ def _detect_after_open_prompt(self, set_callback):
# detector.await_done(timeout=self._prompt_detector_timeout)

def _set_after_open_prompt(self, event):
self.logger.info("Old reverse_state_prompts_dict: {}".format(
self.logger.debug("Old reverse_state_prompts_dict: {}".format(
self._reverse_state_prompts_dict))
occurrence = event.get_last_occurrence()
prompt = re.escape(occurrence['groups'][0].rstrip())
state = self._get_current_state()
self.logger.info("Found prompt '{}' for '{}'.".format(prompt, state))
self.logger.debug("Found prompt '{}' for '{}'.".format(prompt, state))
with self._state_prompts_lock:
self._state_prompts[state] = prompt
self.logger.info("New prompts: {}".format(self._state_prompts))
self.logger.debug("New prompts: {}".format(self._state_prompts))
self._prepare_reverse_state_prompts_dict()
self.logger.info("After prepare_reverse_state_prompts_dict: {}".format(self._reverse_state_prompts_dict))
self.logger.debug("After prepare_reverse_state_prompts_dict: {}".format(self._reverse_state_prompts_dict))
if self._prompts_event is not None:
self.logger.info("prompts event is not none")
self.logger.debug("prompts event is not none")
self._prompts_event.change_prompts(prompts=self._reverse_state_prompts_dict)
self._prompt_detected = True

Expand Down Expand Up @@ -447,7 +446,7 @@ def get_cmd(self, cmd_name, cmd_params=None, check_state=True, for_state=None):
for_state=for_state)

def _detect_prompt_get_cmd(self):
self.logger.info("get_cmd was called but prompt has not been detected yet.")
self.logger.debug("get_cmd was called but prompt has not been detected yet.")
for try_nr in range(1, 10, 1):
if self._after_open_prompt_detector is None or self._after_open_prompt_detector.running() is False:
self._detect_after_open_prompt(self._set_after_open_prompt)
Expand All @@ -456,7 +455,7 @@ def _detect_prompt_get_cmd(self):
if self._prompt_detected is True:
break
self.io_connection.moler_connection.sendline(self._detecting_prompt_cmd)
self.logger.info("get_cmd is canceling prompt detector.")
self.logger.debug("get_cmd is canceling prompt detector.")
self._after_open_prompt_detector.cancel()
if self._prompt_detected is True:
break
Expand Down
8 changes: 4 additions & 4 deletions moler/device/unixremote2.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,22 +381,22 @@ def on_connection_made(self, connection):
self._detect_after_open_prompt(self._set_after_open_prompt)

def _set_after_open_prompt(self, event):
self.logger.info("UnixRemote2 reverse_state_prompts_dict: {}".format(
self.logger.debug("UnixRemote2 reverse_state_prompts_dict: {}".format(
self._reverse_state_prompts_dict))
occurrence = event.get_last_occurrence()
prompt = occurrence['groups'][0].rstrip()
state = self._get_current_state()
with self._state_prompts_lock:
self._state_prompts[state] = re.escape(prompt)
self.logger.info("Found prompt '{}' for '{}'.".format(prompt, state))
self.logger.debug("Found prompt '{}' for '{}'.".format(prompt, state))
if state == UNIX_REMOTE:
self._update_depending_on_ux_prompt()
elif state == PROXY_PC:
self._update_depending_on_proxy_prompt()
self.logger.info("UnixRemote2. updated _reverse_state_prompts_dict: {}".format(
self.logger.debug("UnixRemote2. updated _reverse_state_prompts_dict: {}".format(
self._reverse_state_prompts_dict))
if self._prompts_event is not None:
self.logger.info("prompts event is not none")
self.logger.debug("prompts event is not none")
self._prompts_event.change_prompts(prompts=self._reverse_state_prompts_dict)
self._prompt_detected = True

Expand Down

0 comments on commit 293bd1e

Please sign in to comment.