Clearing pipes on creation (#396)

pull/397/head
Tobi 2 years ago committed by GitHub
parent bb0e60ebc3
commit 421749728b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -472,13 +472,11 @@ class UserInterface:
@debounce(500)
def check_on_typing(self, *_):
"""To save latest input from code editor and call syntax check."""
print("typing")
self.editor.gather_changes_and_save()
self.check_macro_syntax()
def check_macro_syntax(self):
"""Check if the programmed macros are allright."""
print("check_macro_syntax")
self.show_status(CTX_MAPPING, None)
for key, output in active_preset:
output = output[0]

@ -87,6 +87,12 @@ class Pipe:
self._handles = (open(self._fds[0], "r"), open(self._fds[1], "w"))
# clear the pipe of any contents, to avoid leftover messages from breaking
# the helper
while self.poll():
leftover = self.recv()
logger.debug('Cleared leftover message "%s"', leftover)
def recv(self):
"""Read an object from the pipe or None if nothing available.

Loading…
Cancel
Save