diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-04-25 00:35:03 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-05-05 11:08:12 -0400 |
commit | bf4bd5cfc14bc7b108038580789e2e1e3a21ce72 (patch) | |
tree | ca7a10c7bd6602f4b84bf10732b2528c6bf78b38 /klippy | |
parent | a68bb935dfa8e78a090d865d8596a442e6391ec9 (diff) | |
download | kutter-bf4bd5cfc14bc7b108038580789e2e1e3a21ce72.tar.gz kutter-bf4bd5cfc14bc7b108038580789e2e1e3a21ce72.tar.xz kutter-bf4bd5cfc14bc7b108038580789e2e1e3a21ce72.zip |
gcode: Remove parsing helpers from main gcode class
Remove the parsing helpers from the main gcode class now that all
callers have been converted to use the parsing helpers in the
GCodeCommand class.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/gcode.py | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py index faa5d29f..c6d85126 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -15,8 +15,6 @@ class GCodeCommand: # Method wrappers self.respond_info = gcode.respond_info self.respond_raw = gcode.respond_raw - self.__contains__ = self._params.__contains__ - self.__getitem__ = self._params.__getitem__ def get_command(self): return self._command def get_commandline(self): @@ -277,8 +275,6 @@ class GCodeParser: # Build gcode "params" dictionary params = { parts[i]: parts[i+1].strip() for i in range(1, numparts, 2) } - params['#original'] = origline - params['#command'] = cmd gcmd = GCodeCommand(self, cmd, origline, params) # Invoke handler for command self.need_ack = need_ack @@ -396,16 +392,6 @@ class GCodeParser: def _respond_state(self, state): self.respond_info("Klipper state: %s" % (state,), log=False) # Parameter parsing helpers - def get_str(self, name, gcmd, default=GCodeCommand.sentinel, parser=str, - minval=None, maxval=None, above=None, below=None): - return gcmd.get(name, default, parser, minval, maxval, above, below) - def get_int(self, name, gcmd, default=GCodeCommand.sentinel, - minval=None, maxval=None): - return gcmd.get_int(name, default, minval=minval, maxval=maxval) - def get_float(self, name, gcmd, default=GCodeCommand.sentinel, - minval=None, maxval=None, above=None, below=None): - return gcmd.get_float(name, default, minval=minval, maxval=maxval, - above=above, below=below) extended_r = re.compile( r'^\s*(?:N[0-9]+\s*)?' r'(?P<cmd>[a-zA-Z_][a-zA-Z0-9_]+)(?:\s+|$)' @@ -420,8 +406,6 @@ class GCodeParser: try: eparams = [earg.split('=', 1) for earg in shlex.split(eargs)] eparams = { k.upper(): v for k, v in eparams } - eparams['#original'] = gcmd._params['#original'] - eparams['#command'] = gcmd._params['#command'] gcmd._params.clear() gcmd._params.update(eparams) return gcmd |