Skip to content

Commit

Permalink
v4
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-usielski committed Nov 14, 2024
1 parent 6508954 commit 121906a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion moler/device/proxy_pc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,11 @@ def _detect_after_open_prompt(self, set_callback):
self.io_connection.moler_connection.sendline(self._detecting_prompt_cmd)

def _set_after_open_prompt(self, event):
current_thread = threading.current_thread()
occurrence = event.get_last_occurrence()
prompt = occurrence['groups'][0].rstrip()
state = self._get_current_state()
self.logger.info(f"ProxyPc2 for state '{state}' new prompt '{prompt}' reverse_state_prompts_dict: '{self._reverse_state_prompts_dict}'.")
self.logger.info(f"ProxyPc2 for state '{state}' new prompt '{prompt}' reverse_state_prompts_dict: '{self._reverse_state_prompts_dict}' Current thread: {current_thread.name}, ID: {current_thread.ident}.")
with self._state_prompts_lock:
old_prompt = self._state_prompts.get(state, None)
prompt = re.escape(prompt)
Expand Down
4 changes: 3 additions & 1 deletion moler/device/unixremote2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
__email__ = '[email protected], [email protected], [email protected]'

import re
import threading
from moler.device.textualdevice import TextualDevice
from moler.device.unixlocal import UnixLocal
from moler.device.proxy_pc2 import ProxyPc2, PROXY_PC
Expand Down Expand Up @@ -388,10 +389,11 @@ def on_connection_made(self, connection):
self._detect_after_open_prompt(self._set_after_open_prompt)

def _set_after_open_prompt(self, event):
current_thread = threading.current_thread()
occurrence = event.get_last_occurrence()
prompt = occurrence['groups'][0].rstrip()
state = self._get_current_state()
self.logger.info(f"UnixRemote2 for state '{state}' new prompt '{prompt}' reverse_state_prompts_dict: '{self._reverse_state_prompts_dict}'.")
self.logger.info(f"UnixRemote2 for state '{state}' new prompt '{prompt}' reverse_state_prompts_dict: '{self._reverse_state_prompts_dict}' Current thread: {current_thread.name}, ID: {current_thread.ident}.")
with self._state_prompts_lock:
old_prompt = self._state_prompts.get(state, None)
prompt = re.escape(prompt)
Expand Down

0 comments on commit 121906a

Please sign in to comment.