From 4ad44e3e83c819dacb6f620abfdefdd1ecdf7caf Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 30 Jun 2018 14:08:02 -0400 Subject: [PATCH] gcode: Rename run_script() to run_script_from_command() Emphasize that the run_script() method is only valid when run from a g-code command. Signed-off-by: Kevin O'Connor --- klippy/extras/bed_tilt.py | 2 +- klippy/extras/delta_calibrate.py | 2 +- klippy/extras/gcode_macro.py | 2 +- klippy/extras/homing_override.py | 2 +- klippy/extras/probe.py | 6 +++--- klippy/gcode.py | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/klippy/extras/bed_tilt.py b/klippy/extras/bed_tilt.py index 6835ff78..c9663902 100644 --- a/klippy/extras/bed_tilt.py +++ b/klippy/extras/bed_tilt.py @@ -46,7 +46,7 @@ class BedTiltCalibrate: desc=self.cmd_BED_TILT_CALIBRATE_help) cmd_BED_TILT_CALIBRATE_help = "Bed tilt calibration script" def cmd_BED_TILT_CALIBRATE(self, params): - self.gcode.run_script("G28") + self.gcode.run_script_from_command("G28") self.probe_helper.start_probe() def get_probed_position(self): kin = self.printer.lookup_object('toolhead').get_kinematics() diff --git a/klippy/extras/delta_calibrate.py b/klippy/extras/delta_calibrate.py index 18f5671e..15b9001c 100644 --- a/klippy/extras/delta_calibrate.py +++ b/klippy/extras/delta_calibrate.py @@ -28,7 +28,7 @@ class DeltaCalibrate: desc=self.cmd_DELTA_CALIBRATE_help) cmd_DELTA_CALIBRATE_help = "Delta calibration script" def cmd_DELTA_CALIBRATE(self, params): - self.gcode.run_script("G28") + self.gcode.run_script_from_command("G28") self.probe_helper.start_probe() def get_probed_position(self): kin = self.printer.lookup_object('toolhead').get_kinematics() diff --git a/klippy/extras/gcode_macro.py b/klippy/extras/gcode_macro.py index 08ad3b74..6d85f39f 100644 --- a/klippy/extras/gcode_macro.py +++ b/klippy/extras/gcode_macro.py @@ -21,7 +21,7 @@ class GCodeMacro: raise self.gcode.error("Macro %s called recursively" % (self.alias,)) self.in_script = True try: - self.gcode.run_script(self.script) + self.gcode.run_script_from_command(self.script) finally: self.in_script = False diff --git a/klippy/extras/homing_override.py b/klippy/extras/homing_override.py index 17a3911e..117fdf7c 100644 --- a/klippy/extras/homing_override.py +++ b/klippy/extras/homing_override.py @@ -54,7 +54,7 @@ class HomingOverride: # Perform homing try: self.in_script = True - self.gcode.run_script(self.script) + self.gcode.run_script_from_command(self.script) finally: self.in_script = False diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py index f89770a6..26eaa932 100644 --- a/klippy/extras/probe.py +++ b/klippy/extras/probe.py @@ -106,10 +106,10 @@ class ProbeEndstopWrapper: self.query_endstop_wait = self.mcu_endstop.query_endstop_wait self.TimeoutError = self.mcu_endstop.TimeoutError def home_prepare(self): - self.gcode.run_script(self.activate_gcode) + self.gcode.run_script_from_command(self.activate_gcode) self.mcu_endstop.home_prepare() def home_finalize(self): - self.gcode.run_script(self.deactivate_gcode) + self.gcode.run_script_from_command(self.deactivate_gcode) self.mcu_endstop.home_finalize() # Wrapper that records the last XY position of a virtual endstop probe @@ -186,7 +186,7 @@ class ProbePointsHelper: if self.probe is not None: try: while self.busy: - self.gcode.run_script("PROBE") + self.gcode.run_script_from_command("PROBE") self.cmd_NEXT({}) except: self.finalize(False) diff --git a/klippy/gcode.py b/klippy/gcode.py index 5e6bcecc..38e1124b 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -235,7 +235,7 @@ class GCodeParser: self.process_pending() self.is_processing_data = False return True - def run_script(self, script): + def run_script_from_command(self, script): prev_need_ack = self.need_ack try: self.process_commands(script.split('\n'), need_ack=False) @@ -390,7 +390,7 @@ class GCodeParser: e = extruders[index] if self.extruder is e: return - self.run_script(self.extruder.get_activate_gcode(False)) + self.run_script_from_command(self.extruder.get_activate_gcode(False)) try: self.toolhead.set_extruder(e) except homing.EndstopError as e: @@ -399,7 +399,7 @@ class GCodeParser: self.reset_last_position() self.extrude_factor = 1. self.base_position[3] = self.last_position[3] - self.run_script(self.extruder.get_activate_gcode(True)) + self.run_script_from_command(self.extruder.get_activate_gcode(True)) def cmd_mux(self, params): key, values = self.mux_commands[params['#command']] if None in values: