diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-06-09 13:33:21 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-06-09 18:44:44 -0400 |
commit | 30d2ae8f9fba2aa618363f13d812e8db886dfd97 (patch) | |
tree | 1d808f6133a8d9eb5719cee5ef16893ebaa97c2c /klippy/gcode.py | |
parent | 962f7b98bd3bafe5ffefc00e22e95a7fab377a10 (diff) | |
download | kutter-30d2ae8f9fba2aa618363f13d812e8db886dfd97.tar.gz kutter-30d2ae8f9fba2aa618363f13d812e8db886dfd97.tar.xz kutter-30d2ae8f9fba2aa618363f13d812e8db886dfd97.zip |
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 <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r-- | klippy/gcode.py | 8 |
1 files changed, 2 insertions, 6 deletions
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: |