From 30d2ae8f9fba2aa618363f13d812e8db886dfd97 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 9 Jun 2019 13:33:21 -0400 Subject: gcode: Eliminate the process_batch() method Allow the callers of process_batch() to directly inspect the gcode mutex. Those callers can then directly invoke run_script(). Signed-off-by: Kevin O'Connor --- klippy/gcode.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'klippy/gcode.py') diff --git a/klippy/gcode.py b/klippy/gcode.py index b740a1e9..15f5c172 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -277,12 +277,6 @@ class GCodeParser: if self.fd_handle is None: self.fd_handle = self.reactor.register_fd(self.fd, self._process_data) - def process_batch(self, commands): - if self.mutex.test(): - return False - with self.mutex: - self._process_commands(commands, need_ack=False) - return True def run_script_from_command(self, script): prev_need_ack = self.need_ack try: @@ -292,6 +286,8 @@ class GCodeParser: def run_script(self, script): with self.mutex: self._process_commands(script.split('\n'), need_ack=False) + def get_mutex(self): + return self.mutex # Response handling def ack(self, msg=None): if not self.need_ack or self.is_fileinput: -- cgit v1.2.3-70-g09d2