Skip to content

Commit

Permalink
remove a few unused variable assignments
Browse files Browse the repository at this point in the history
Signed-off-by: Kamil Domański <[email protected]>
  • Loading branch information
kdomanski committed Feb 23, 2024
1 parent d62a2bd commit 0f195db
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion klippy/configfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ def _find_autosave_data(self, data):
comment_r = re.compile('[#;].*$')
value_r = re.compile('[^A-Za-z0-9_].*$')
def _strip_duplicates(self, data, config):
fileconfig = config.fileconfig
# Comment out fields in 'data' that are defined in 'config'
lines = data.split('\n')
section = None
Expand Down
1 change: 0 additions & 1 deletion klippy/extras/dotstar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
class PrinterDotstar:
def __init__(self, config):
self.printer = printer = config.get_printer()
name = config.get_name().split()[1]
# Configure a software spi bus
ppins = printer.lookup_object('pins')
data_pin_params = ppins.lookup_pin(config.get('data_pin'))
Expand Down
1 change: 0 additions & 1 deletion klippy/extras/endstop_phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ def cmd_ENDSTOP_PHASE_CALIBRATE(self, gcmd):
def generate_stats(self, stepper_name, phase_calc):
phase_history = phase_calc.phase_history
wph = phase_history + phase_history
count = sum(phase_history)
phases = len(phase_history)
half_phases = phases // 2
res = []
Expand Down
4 changes: 0 additions & 4 deletions klippy/extras/heaters.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,10 @@ def _wait_for_temperature(self, heater):
# Helper to wait on heater.check_busy() and report M105 temperatures
if self.printer.get_start_args().get('debugoutput') is not None:
return
toolhead = self.printer.lookup_object("toolhead")
gcode = self.printer.lookup_object("gcode")
reactor = self.printer.get_reactor()
eventtime = reactor.monotonic()
while not self.printer.is_shutdown() and heater.check_busy():
print_time = toolhead.get_last_move_time()
gcode.respond_raw(self._get_temp(eventtime))
eventtime = reactor.pause(eventtime + 1.)
def set_temperature(self, heater, temp, wait=False):
Expand All @@ -358,14 +356,12 @@ def cmd_TEMPERATURE_WAIT(self, gcmd):
sensor = self.heaters[sensor_name]
else:
sensor = self.printer.lookup_object(sensor_name)
toolhead = self.printer.lookup_object("toolhead")
reactor = self.printer.get_reactor()
eventtime = reactor.monotonic()
while not self.printer.is_shutdown():
temp, target = sensor.get_temp(eventtime)
if temp >= min_temp and temp <= max_temp:
return
print_time = toolhead.get_last_move_time()
gcmd.respond_raw(self._get_temp(eventtime))
eventtime = reactor.pause(eventtime + 1.)

Expand Down
2 changes: 1 addition & 1 deletion klippy/extras/idle_timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def transition_idle_state(self, eventtime):
self.state = "Printing"
try:
script = self.idle_gcode.render()
res = self.gcode.run_script(script)
self.gcode.run_script(script)
except:
logging.exception("idle timeout gcode execution")
self.state = "Ready"
Expand Down
1 change: 0 additions & 1 deletion klippy/extras/input_shaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def get_shaper(self):
return self.n, self.A, self.T
def update(self, gcmd):
self.params.update(gcmd)
old_n, old_A, old_T = self.n, self.A, self.T
self.n, self.A, self.T = self.params.get_shaper()
def set_shaper_kinematics(self, sk):
ffi_main, ffi_lib = chelper.get_ffi()
Expand Down
1 change: 0 additions & 1 deletion klippy/kinematics/hybrid_corexy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
class HybridCoreXYKinematics:
def __init__(self, toolhead, config):
self.printer = config.get_printer()
printer_config = config.getsection('printer')
# itersolve parameters
self.rails = [ stepper.PrinterRail(config.getsection('stepper_x')),
stepper.LookupMultiRail(config.getsection('stepper_y')),
Expand Down
1 change: 0 additions & 1 deletion klippy/kinematics/hybrid_corexz.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
class HybridCoreXZKinematics:
def __init__(self, toolhead, config):
self.printer = config.get_printer()
printer_config = config.getsection('printer')
# itersolve parameters
self.rails = [ stepper.PrinterRail(config.getsection('stepper_x')),
stepper.LookupMultiRail(config.getsection('stepper_y')),
Expand Down
1 change: 0 additions & 1 deletion klippy/mcu.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ def _send_config(self, prev_crc):
self._config_cmds.insert(0, "allocate_oids count=%d"
% (self._oid_count,))
# Resolve pin names
mcu_type = self._serial.get_msgparser().get_constant('MCU')
ppins = self._printer.lookup_object('pins')
pin_resolver = ppins.get_pin_resolver(self._name)
for cmdlist in (self._config_cmds, self._restart_cmds, self._init_cmds):
Expand Down
1 change: 0 additions & 1 deletion klippy/toolhead.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@ def register_step_generator(self, handler):
self.step_generators.append(handler)
def note_step_generation_scan_time(self, delay, old_delay=0.):
self.flush_step_generation()
cur_delay = self.kin_flush_delay
if old_delay:
self.kin_flush_times.pop(self.kin_flush_times.index(old_delay))
if delay:
Expand Down

0 comments on commit 0f195db

Please sign in to comment.