Skip to content

Commit

Permalink
Add os.linesep to messages sent through the emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
MicBoucinha committed May 14, 2019
1 parent 454c1de commit ec66ec8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pybpod_gui_plugin_emulator/emulator_gui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pyforms
import os
from pybpodapi.bpod import Bpod
from pybpodgui_api.exceptions.run_setup import RunSetupError
from pybpodgui_plugin.utils import make_lambda_func
Expand Down Expand Up @@ -204,7 +205,7 @@ def __send_msg_btn_evt(self, btn=None, control_text=None):
if btn is None or control_text is None:
return
module_index = btn.name[-1]
message = f"message:{module_index}:{control_text.value}\n"
message = f'message:{module_index}:{control_text.value}{os.linesep}'

# send msg through stdin to bpod (we need to create a command first in the other side)
self.setup.board.proc.stdin.write(message.encode('utf-8'))
Expand Down Expand Up @@ -238,9 +239,9 @@ def __button_on_click_evt(self, btn=None):
btn.icon = self.UNCHECKED_ICON

if is_output:
message = f'trigger_output:{port_name}{port_number}:{val}\n'
message = f'trigger_output:{port_name}{port_number}:{val}{os.linesep}'
else:
message = f'trigger_input:{port_name}{port_number}:{val}\n'
message = f'trigger_input:{port_name}{port_number}:{val}{os.linesep}'

self.setup.board.proc.stdin.write(message.encode('utf-8'))
self.setup.board.proc.stdin.flush()
Expand Down

0 comments on commit ec66ec8

Please sign in to comment.