diff options
author | Tomasz Kramkowski <tomasz@kramkow.ski> | 2025-08-15 21:47:41 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tomasz@kramkow.ski> | 2025-08-15 21:47:41 +0100 |
commit | a961fbda426d79dc3c33a66848408e84b0737a98 (patch) | |
tree | 264ffa9a3be219cb4ec067f64030af64e67521ee /klippy/extras | |
parent | e48c5758975756271ae4bf4b9eae538d0a411c21 (diff) | |
download | kutter-a961fbda426d79dc3c33a66848408e84b0737a98.tar.gz kutter-a961fbda426d79dc3c33a66848408e84b0737a98.tar.xz kutter-a961fbda426d79dc3c33a66848408e84b0737a98.zip |
Isort all klippy code
Diffstat (limited to 'klippy/extras')
77 files changed, 187 insertions, 63 deletions
diff --git a/klippy/extras/adc_temperature.py b/klippy/extras/adc_temperature.py index ef05c52b..2bad0349 100644 --- a/klippy/extras/adc_temperature.py +++ b/klippy/extras/adc_temperature.py @@ -3,8 +3,8 @@ # Copyright (C) 2016-2024 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, bisect - +import bisect +import logging ###################################################################### # Interface between MCU adc and heater temperature callbacks diff --git a/klippy/extras/ads1220.py b/klippy/extras/ads1220.py index d1ccc9c9..0e3e6bbb 100644 --- a/klippy/extras/ads1220.py +++ b/klippy/extras/ads1220.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import bulk_sensor, bus # diff --git a/klippy/extras/ads1x1x.py b/klippy/extras/ads1x1x.py index 43bdea25..a76a14d9 100644 --- a/klippy/extras/ads1x1x.py +++ b/klippy/extras/ads1x1x.py @@ -4,7 +4,9 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + import pins + from . import bus # Supported chip types diff --git a/klippy/extras/adxl345.py b/klippy/extras/adxl345.py index 7870bd4a..4d64ad14 100644 --- a/klippy/extras/adxl345.py +++ b/klippy/extras/adxl345.py @@ -3,8 +3,13 @@ # Copyright (C) 2020-2023 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, time, collections, multiprocessing, os -from . import bus, bulk_sensor +import collections +import logging +import multiprocessing +import os +import time + +from . import bulk_sensor, bus # ADXL345 registers REG_DEVID = 0x00 diff --git a/klippy/extras/aht10.py b/klippy/extras/aht10.py index f680004d..320ccb36 100644 --- a/klippy/extras/aht10.py +++ b/klippy/extras/aht10.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import bus ###################################################################### diff --git a/klippy/extras/angle.py b/klippy/extras/angle.py index f2799543..c857a14f 100644 --- a/klippy/extras/angle.py +++ b/klippy/extras/angle.py @@ -3,8 +3,10 @@ # Copyright (C) 2021,2022 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, math -from . import bus, bulk_sensor +import logging +import math + +from . import bulk_sensor, bus MIN_MSG_TIME = 0.100 TCODE_ERROR = 0xFF diff --git a/klippy/extras/axis_twist_compensation.py b/klippy/extras/axis_twist_compensation.py index ae3c9811..f0008e1b 100644 --- a/klippy/extras/axis_twist_compensation.py +++ b/klippy/extras/axis_twist_compensation.py @@ -5,8 +5,8 @@ # This file may be distributed under the terms of the GNU GPLv3 license. import math -from . import manual_probe, bed_mesh, probe +from . import bed_mesh, manual_probe, probe DEFAULT_SAMPLE_COUNT = 3 DEFAULT_SPEED = 50.0 diff --git a/klippy/extras/bed_mesh.py b/klippy/extras/bed_mesh.py index 921b6296..9fb3701b 100644 --- a/klippy/extras/bed_mesh.py +++ b/klippy/extras/bed_mesh.py @@ -3,7 +3,11 @@ # Copyright (C) 2018-2019 Eric Callahan <arksine.code@gmail.com> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, math, json, collections +import collections +import json +import logging +import math + from . import probe PROFILE_VERSION = 1 diff --git a/klippy/extras/bed_tilt.py b/klippy/extras/bed_tilt.py index 1bbce154..bb05343f 100644 --- a/klippy/extras/bed_tilt.py +++ b/klippy/extras/bed_tilt.py @@ -4,7 +4,9 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + import mathutil + from . import probe diff --git a/klippy/extras/bltouch.py b/klippy/extras/bltouch.py index 76823a25..d4206089 100644 --- a/klippy/extras/bltouch.py +++ b/klippy/extras/bltouch.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import probe SIGNAL_PERIOD = 0.020 diff --git a/klippy/extras/bme280.py b/klippy/extras/bme280.py index 44de9de3..e4c1f1ca 100644 --- a/klippy/extras/bme280.py +++ b/klippy/extras/bme280.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import bus REPORT_TIME = 0.8 diff --git a/klippy/extras/bulk_sensor.py b/klippy/extras/bulk_sensor.py index cd112e1a..e28bcbdc 100644 --- a/klippy/extras/bulk_sensor.py +++ b/klippy/extras/bulk_sensor.py @@ -3,7 +3,9 @@ # Copyright (C) 2020-2023 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, threading, struct +import logging +import struct +import threading # This "bulk sensor" module facilitates the processing of sensor chip # measurements that do not require the host to respond with low diff --git a/klippy/extras/buttons.py b/klippy/extras/buttons.py index 0b90f1a3..edb3adec 100644 --- a/klippy/extras/buttons.py +++ b/klippy/extras/buttons.py @@ -5,7 +5,6 @@ # This file may be distributed under the terms of the GNU GPLv3 license. import logging - ###################################################################### # Button state tracking ###################################################################### diff --git a/klippy/extras/delta_calibrate.py b/klippy/extras/delta_calibrate.py index 342aa110..1a6ad8c8 100644 --- a/klippy/extras/delta_calibrate.py +++ b/klippy/extras/delta_calibrate.py @@ -3,8 +3,12 @@ # Copyright (C) 2017-2019 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import math, logging, collections +import collections +import logging +import math + import mathutil + from . import probe # A "stable position" is a 3-tuple containing the number of steps diff --git a/klippy/extras/display/display.py b/klippy/extras/display/display.py index c381cf09..be11ac43 100644 --- a/klippy/extras/display/display.py +++ b/klippy/extras/display/display.py @@ -5,8 +5,11 @@ # Copyright (C) 2018 Eric Callahan <arksine.code@gmail.com> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, os, ast -from . import aip31068_spi, hd44780, hd44780_spi, st7920, uc1701, menu +import ast +import logging +import os + +from . import aip31068_spi, hd44780, hd44780_spi, menu, st7920, uc1701 # Normal time between each screen redraw REDRAW_TIME = 0.500 diff --git a/klippy/extras/display/hd44780_spi.py b/klippy/extras/display/hd44780_spi.py index dd46acd3..98a0c48d 100644 --- a/klippy/extras/display/hd44780_spi.py +++ b/klippy/extras/display/hd44780_spi.py @@ -6,6 +6,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from .. import bus LINE_LENGTH_DEFAULT = 20 diff --git a/klippy/extras/display/menu.py b/klippy/extras/display/menu.py index 717b6084..230b9f97 100644 --- a/klippy/extras/display/menu.py +++ b/klippy/extras/display/menu.py @@ -4,8 +4,12 @@ # Copyright (C) 2020 Janar Sööt <janar.soot@gmail.com> # # This file may be distributed under the terms of the GNU GPLv3 license. -import os, logging, ast, re +import ast +import logging +import os +import re from string import Template + from . import menu_keys diff --git a/klippy/extras/display/st7920.py b/klippy/extras/display/st7920.py index 9411a064..624d180b 100644 --- a/klippy/extras/display/st7920.py +++ b/klippy/extras/display/st7920.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from .. import bus from . import font8x14 diff --git a/klippy/extras/display/uc1701.py b/klippy/extras/display/uc1701.py index 7d4e4683..3129b7bc 100644 --- a/klippy/extras/display/uc1701.py +++ b/klippy/extras/display/uc1701.py @@ -5,6 +5,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from .. import bus from . import font8x14 diff --git a/klippy/extras/ds18b20.py b/klippy/extras/ds18b20.py index e9c52fde..30750fd8 100644 --- a/klippy/extras/ds18b20.py +++ b/klippy/extras/ds18b20.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + import mcu DS18_REPORT_TIME = 3.0 diff --git a/klippy/extras/endstop_phase.py b/klippy/extras/endstop_phase.py index 52d88681..58a627cb 100644 --- a/klippy/extras/endstop_phase.py +++ b/klippy/extras/endstop_phase.py @@ -3,7 +3,9 @@ # Copyright (C) 2016-2021 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import math, logging +import logging +import math + import stepper TRINAMIC_DRIVERS = ["tmc2130", "tmc2208", "tmc2209", "tmc2240", "tmc2660", "tmc5160"] diff --git a/klippy/extras/exclude_object.py b/klippy/extras/exclude_object.py index 3043e8dd..eb8700b3 100644 --- a/klippy/extras/exclude_object.py +++ b/klippy/extras/exclude_object.py @@ -5,8 +5,8 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging import json +import logging class ExcludeObject: diff --git a/klippy/extras/extruder_stepper.py b/klippy/extras/extruder_stepper.py index b5feddf1..8ed085fe 100644 --- a/klippy/extras/extruder_stepper.py +++ b/klippy/extras/extruder_stepper.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from kinematics import extruder diff --git a/klippy/extras/fan.py b/klippy/extras/fan.py index 081db642..ee52a101 100644 --- a/klippy/extras/fan.py +++ b/klippy/extras/fan.py @@ -3,7 +3,7 @@ # Copyright (C) 2016-2024 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -from . import pulse_counter, output_pin +from . import output_pin, pulse_counter class Fan: diff --git a/klippy/extras/fan_generic.py b/klippy/extras/fan_generic.py index 3a9b3791..4a400c03 100644 --- a/klippy/extras/fan_generic.py +++ b/klippy/extras/fan_generic.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import fan, output_pin diff --git a/klippy/extras/filament_motion_sensor.py b/klippy/extras/filament_motion_sensor.py index 71a01949..59f3c943 100644 --- a/klippy/extras/filament_motion_sensor.py +++ b/klippy/extras/filament_motion_sensor.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import filament_switch_sensor CHECK_RUNOUT_TIMEOUT = 0.250 diff --git a/klippy/extras/force_move.py b/klippy/extras/force_move.py index dfdc26f2..c43b3d0c 100644 --- a/klippy/extras/force_move.py +++ b/klippy/extras/force_move.py @@ -3,7 +3,9 @@ # Copyright (C) 2018-2019 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import math, logging +import logging +import math + import chelper BUZZ_DISTANCE = 1.0 diff --git a/klippy/extras/gcode_macro.py b/klippy/extras/gcode_macro.py index ddcdc7c9..017f8dd0 100644 --- a/klippy/extras/gcode_macro.py +++ b/klippy/extras/gcode_macro.py @@ -3,9 +3,13 @@ # Copyright (C) 2018-2021 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import traceback, logging, ast, copy, json -import jinja2 +import ast +import copy +import json +import logging +import traceback +import jinja2 ###################################################################### # Template handling diff --git a/klippy/extras/heaters.py b/klippy/extras/heaters.py index ce06955e..f188bd23 100644 --- a/klippy/extras/heaters.py +++ b/klippy/extras/heaters.py @@ -3,8 +3,9 @@ # Copyright (C) 2016-2025 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import os, logging, threading - +import logging +import os +import threading ###################################################################### # Heater diff --git a/klippy/extras/homing.py b/klippy/extras/homing.py index 0a2b1f32..a98478b8 100644 --- a/klippy/extras/homing.py +++ b/klippy/extras/homing.py @@ -3,7 +3,8 @@ # Copyright (C) 2016-2024 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, math +import logging +import math HOMING_START_DELAY = 0.001 ENDSTOP_SAMPLE_TIME = 0.000015 diff --git a/klippy/extras/htu21d.py b/klippy/extras/htu21d.py index d7104503..cf3b4c4a 100644 --- a/klippy/extras/htu21d.py +++ b/klippy/extras/htu21d.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import bus ###################################################################### diff --git a/klippy/extras/hx71x.py b/klippy/extras/hx71x.py index ad3134f8..5c25689a 100644 --- a/klippy/extras/hx71x.py +++ b/klippy/extras/hx71x.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import bulk_sensor # diff --git a/klippy/extras/icm20948.py b/klippy/extras/icm20948.py index c99224fa..5b1b137d 100644 --- a/klippy/extras/icm20948.py +++ b/klippy/extras/icm20948.py @@ -10,7 +10,8 @@ # 2016/06/DS-000189-ICM-20948-v1.3.pdf import logging -from . import bus, adxl345, bulk_sensor + +from . import adxl345, bulk_sensor, bus ICM20948_ADDR = 0x68 diff --git a/klippy/extras/input_shaper.py b/klippy/extras/input_shaper.py index 70a68fd1..90c168e5 100644 --- a/klippy/extras/input_shaper.py +++ b/klippy/extras/input_shaper.py @@ -5,7 +5,9 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import collections + import chelper + from . import shaper_defs diff --git a/klippy/extras/ldc1612.py b/klippy/extras/ldc1612.py index 1bec5c35..74330a02 100644 --- a/klippy/extras/ldc1612.py +++ b/klippy/extras/ldc1612.py @@ -4,7 +4,8 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging -from . import bus, bulk_sensor + +from . import bulk_sensor, bus MIN_MSG_TIME = 0.100 diff --git a/klippy/extras/led.py b/klippy/extras/led.py index b22ddf72..e1fe149e 100644 --- a/klippy/extras/led.py +++ b/klippy/extras/led.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import output_pin diff --git a/klippy/extras/lis2dw.py b/klippy/extras/lis2dw.py index a0d582bb..1a5506fd 100644 --- a/klippy/extras/lis2dw.py +++ b/klippy/extras/lis2dw.py @@ -5,7 +5,8 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging -from . import bus, adxl345, bulk_sensor + +from . import adxl345, bulk_sensor, bus # LIS2DW registers REG_LIS2DW_WHO_AM_I_ADDR = 0x0F diff --git a/klippy/extras/lm75.py b/klippy/extras/lm75.py index 10fbcb9f..444e650b 100644 --- a/klippy/extras/lm75.py +++ b/klippy/extras/lm75.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import bus LM75_CHIP_ADDR = 0x48 diff --git a/klippy/extras/load_cell.py b/klippy/extras/load_cell.py index 3481c06e..9b13cecd 100644 --- a/klippy/extras/load_cell.py +++ b/klippy/extras/load_cell.py @@ -4,10 +4,11 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. -from . import hx71x -from . import ads1220 +import collections +import itertools + +from . import ads1220, hx71x from .bulk_sensor import BatchWebhooksClient -import collections, itertools # We want either Python 3's zip() or Python 2's izip() but NOT 2's zip(): zip_impl = zip diff --git a/klippy/extras/load_cell_probe.py b/klippy/extras/load_cell_probe.py index de54792f..6407ccbf 100644 --- a/klippy/extras/load_cell_probe.py +++ b/klippy/extras/load_cell_probe.py @@ -3,9 +3,12 @@ # Copyright (C) 2025 Gareth Farrington <gareth@waves.ky> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, math +import logging +import math + import mcu -from . import probe, sos_filter, load_cell, hx71x, ads1220 + +from . import ads1220, hx71x, load_cell, probe, sos_filter np = None # delay NumPy import until configuration time diff --git a/klippy/extras/manual_probe.py b/klippy/extras/manual_probe.py index 176a97e5..48acf4f1 100644 --- a/klippy/extras/manual_probe.py +++ b/klippy/extras/manual_probe.py @@ -3,7 +3,8 @@ # Copyright (C) 2019 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, bisect +import bisect +import logging # Helper to lookup the Z stepper config section diff --git a/klippy/extras/manual_stepper.py b/klippy/extras/manual_stepper.py index eeba2e93..c4da3265 100644 --- a/klippy/extras/manual_stepper.py +++ b/klippy/extras/manual_stepper.py @@ -4,7 +4,10 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging -import stepper, chelper + +import chelper +import stepper + from . import force_move diff --git a/klippy/extras/motion_report.py b/klippy/extras/motion_report.py index 4b4debcb..8819a12b 100644 --- a/klippy/extras/motion_report.py +++ b/klippy/extras/motion_report.py @@ -4,7 +4,9 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + import chelper + from . import bulk_sensor diff --git a/klippy/extras/mpu9250.py b/klippy/extras/mpu9250.py index 189f1f98..15103b9f 100644 --- a/klippy/extras/mpu9250.py +++ b/klippy/extras/mpu9250.py @@ -5,7 +5,8 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging -from . import bus, adxl345, bulk_sensor + +from . import adxl345, bulk_sensor, bus MPU9250_ADDR = 0x68 diff --git a/klippy/extras/neopixel.py b/klippy/extras/neopixel.py index 1bed21b4..eccec556 100644 --- a/klippy/extras/neopixel.py +++ b/klippy/extras/neopixel.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import led BACKGROUND_PRIORITY_CLOCK = 0x7FFFFFFF00000000 diff --git a/klippy/extras/output_pin.py b/klippy/extras/output_pin.py index 85a9e91c..2b3592a7 100644 --- a/klippy/extras/output_pin.py +++ b/klippy/extras/output_pin.py @@ -3,9 +3,10 @@ # Copyright (C) 2017-2025 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, ast -from .display import display +import ast +import logging +from .display import display ###################################################################### # G-Code request queuing helper diff --git a/klippy/extras/palette2.py b/klippy/extras/palette2.py index 1679eec3..c0026886 100644 --- a/klippy/extras/palette2.py +++ b/klippy/extras/palette2.py @@ -6,14 +6,14 @@ import logging import os -import serial +import serial from serial import SerialException try: - from queue import Queue, Empty + from queue import Empty, Queue except ImportError: - from Queue import Queue, Empty + from Queue import Empty, Queue COMMAND_HEARTBEAT = "O99" COMMAND_CUT = "O10 D5" diff --git a/klippy/extras/pca9533.py b/klippy/extras/pca9533.py index c56ff71c..9048507d 100644 --- a/klippy/extras/pca9533.py +++ b/klippy/extras/pca9533.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import bus, led BACKGROUND_PRIORITY_CLOCK = 0x7FFFFFFF00000000 diff --git a/klippy/extras/pid_calibrate.py b/klippy/extras/pid_calibrate.py index a29f0b71..faf867e5 100644 --- a/klippy/extras/pid_calibrate.py +++ b/klippy/extras/pid_calibrate.py @@ -3,7 +3,9 @@ # Copyright (C) 2016-2018 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import math, logging +import logging +import math + from . import heaters diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py index 3811f883..88b8ebe6 100644 --- a/klippy/extras/probe.py +++ b/klippy/extras/probe.py @@ -4,7 +4,9 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + import pins + from . import manual_probe HINT_TIMEOUT = """ diff --git a/klippy/extras/probe_eddy_current.py b/klippy/extras/probe_eddy_current.py index 529b097c..256f9d3a 100644 --- a/klippy/extras/probe_eddy_current.py +++ b/klippy/extras/probe_eddy_current.py @@ -3,9 +3,13 @@ # Copyright (C) 2021-2024 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, math, bisect +import bisect +import logging +import math + import mcu -from . import ldc1612, probe, manual_probe + +from . import ldc1612, manual_probe, probe OUT_OF_RANGE = 99.9 diff --git a/klippy/extras/quad_gantry_level.py b/klippy/extras/quad_gantry_level.py index 4dbdc47e..5bbb356f 100644 --- a/klippy/extras/quad_gantry_level.py +++ b/klippy/extras/quad_gantry_level.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import probe, z_tilt # Leveling code for XY rails that are controlled by Z steppers as in: diff --git a/klippy/extras/replicape.py b/klippy/extras/replicape.py index 8f62a959..cad70036 100644 --- a/klippy/extras/replicape.py +++ b/klippy/extras/replicape.py @@ -3,8 +3,12 @@ # Copyright (C) 2017-2019 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, os -import pins, mcu +import logging +import os + +import mcu +import pins + from . import bus REPLICAPE_MAX_CURRENT = 3.84 diff --git a/klippy/extras/resonance_tester.py b/klippy/extras/resonance_tester.py index 85dac5ee..4d5f8b65 100644 --- a/klippy/extras/resonance_tester.py +++ b/klippy/extras/resonance_tester.py @@ -3,7 +3,11 @@ # Copyright (C) 2020-2024 Dmitry Butyugin <dmbutyugin@google.com> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, math, os, time +import logging +import math +import os +import time + from . import shaper_calibrate diff --git a/klippy/extras/save_variables.py b/klippy/extras/save_variables.py index 043f1c6d..f949e58f 100644 --- a/klippy/extras/save_variables.py +++ b/klippy/extras/save_variables.py @@ -4,7 +4,10 @@ # Copyright (C) 2016-2020 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import os, logging, ast, configparser +import ast +import configparser +import logging +import os class SaveVariables: diff --git a/klippy/extras/screws_tilt_adjust.py b/klippy/extras/screws_tilt_adjust.py index 6dacde87..f98dd75d 100644 --- a/klippy/extras/screws_tilt_adjust.py +++ b/klippy/extras/screws_tilt_adjust.py @@ -5,6 +5,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import math + from . import probe diff --git a/klippy/extras/shaper_calibrate.py b/klippy/extras/shaper_calibrate.py index 117409aa..5b440426 100644 --- a/klippy/extras/shaper_calibrate.py +++ b/klippy/extras/shaper_calibrate.py @@ -3,7 +3,12 @@ # Copyright (C) 2020-2024 Dmitry Butyugin <dmbutyugin@google.com> # # This file may be distributed under the terms of the GNU GPLv3 license. -import collections, importlib, logging, math, multiprocessing, traceback +import collections +import importlib +import logging +import math +import multiprocessing +import traceback shaper_defs = importlib.import_module(".shaper_defs", "extras") diff --git a/klippy/extras/shaper_defs.py b/klippy/extras/shaper_defs.py index 1cd7aeed..080e21ea 100644 --- a/klippy/extras/shaper_defs.py +++ b/klippy/extras/shaper_defs.py @@ -3,7 +3,8 @@ # Copyright (C) 2020-2021 Dmitry Butyugin <dmbutyugin@google.com> # # This file may be distributed under the terms of the GNU GPLv3 license. -import collections, math +import collections +import math SHAPER_VIBRATION_REDUCTION = 20.0 DEFAULT_DAMPING_RATIO = 0.1 diff --git a/klippy/extras/sht3x.py b/klippy/extras/sht3x.py index d6acd987..030737da 100644 --- a/klippy/extras/sht3x.py +++ b/klippy/extras/sht3x.py @@ -5,6 +5,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import bus ###################################################################### diff --git a/klippy/extras/smart_effector.py b/klippy/extras/smart_effector.py index 2ddee5e9..3886dea7 100644 --- a/klippy/extras/smart_effector.py +++ b/klippy/extras/smart_effector.py @@ -5,6 +5,7 @@ # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import probe # SmartEffector communication protocol implemented here originates from diff --git a/klippy/extras/spi_temperature.py b/klippy/extras/spi_temperature.py index 38d6b559..31b1f39c 100644 --- a/klippy/extras/spi_temperature.py +++ b/klippy/extras/spi_temperature.py @@ -4,9 +4,10 @@ # Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import math, logging -from . import bus +import logging +import math +from . import bus ###################################################################### # SensorBase diff --git a/klippy/extras/statistics.py b/klippy/extras/statistics.py index de7302e7..c4243618 100644 --- a/klippy/extras/statistics.py +++ b/klippy/extras/statistics.py @@ -3,7 +3,9 @@ # Copyright (C) 2018-2021 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import os, time, logging +import logging +import os +import time class PrinterSysStats: diff --git a/klippy/extras/sx1509.py b/klippy/extras/sx1509.py index 22a6c6a7..358ba8a2 100644 --- a/klippy/extras/sx1509.py +++ b/klippy/extras/sx1509.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import pins + from . import bus # Word registers diff --git a/klippy/extras/temperature_mcu.py b/klippy/extras/temperature_mcu.py index 1b4d983a..c79f16f8 100644 --- a/klippy/extras/temperature_mcu.py +++ b/klippy/extras/temperature_mcu.py @@ -4,7 +4,9 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + import mcu + from . import adc_temperature SAMPLE_TIME = 0.001 diff --git a/klippy/extras/temperature_probe.py b/klippy/extras/temperature_probe.py index 1d5327d7..e54f259f 100644 --- a/klippy/extras/temperature_probe.py +++ b/klippy/extras/temperature_probe.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + from . import manual_probe KELVIN_TO_CELSIUS = -273.15 diff --git a/klippy/extras/thermistor.py b/klippy/extras/thermistor.py index db1288e5..cb9f639e 100644 --- a/klippy/extras/thermistor.py +++ b/klippy/extras/thermistor.py @@ -3,7 +3,9 @@ # Copyright (C) 2016-2019 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import math, logging +import logging +import math + from . import adc_temperature KELVIN_TO_CELSIUS = -273.15 diff --git a/klippy/extras/tmc.py b/klippy/extras/tmc.py index 4a7bcc9c..15d7fe0d 100644 --- a/klippy/extras/tmc.py +++ b/klippy/extras/tmc.py @@ -3,10 +3,12 @@ # Copyright (C) 2018-2020 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging, collections +import collections +import logging + import stepper -from . import bulk_sensor +from . import bulk_sensor ###################################################################### # Field helpers diff --git a/klippy/extras/tmc2130.py b/klippy/extras/tmc2130.py index 88c7fcf4..fbe0a969 100644 --- a/klippy/extras/tmc2130.py +++ b/klippy/extras/tmc2130.py @@ -3,7 +3,9 @@ # Copyright (C) 2018-2019 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import math, logging +import logging +import math + from . import bus, tmc TMC_FREQUENCY = 13200000.0 diff --git a/klippy/extras/tmc2208.py b/klippy/extras/tmc2208.py index fcf057ce..488b0b7f 100644 --- a/klippy/extras/tmc2208.py +++ b/klippy/extras/tmc2208.py @@ -4,7 +4,8 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging -from . import tmc, tmc_uart, tmc2130 + +from . import tmc, tmc2130, tmc_uart TMC_FREQUENCY = 12000000.0 diff --git a/klippy/extras/tmc2209.py b/klippy/extras/tmc2209.py index 5fc3ae17..62cf4f74 100644 --- a/klippy/extras/tmc2209.py +++ b/klippy/extras/tmc2209.py @@ -3,7 +3,7 @@ # Copyright (C) 2019 Stephan Oelze <stephan.oelze@gmail.com> # # This file may be distributed under the terms of the GNU GPLv3 license. -from . import tmc2208, tmc2130, tmc, tmc_uart +from . import tmc, tmc2130, tmc2208, tmc_uart TMC_FREQUENCY = 12000000.0 diff --git a/klippy/extras/tmc2240.py b/klippy/extras/tmc2240.py index b6d13935..01163795 100644 --- a/klippy/extras/tmc2240.py +++ b/klippy/extras/tmc2240.py @@ -4,7 +4,9 @@ # Copyright (C) 2023 Alex Voinea <voinea.dragos.alexandru@gmail.com> # # This file may be distributed under the terms of the GNU GPLv3 license. -import math, logging +import logging +import math + from . import bus, tmc, tmc2130, tmc_uart TMC_FREQUENCY = 12500000.0 diff --git a/klippy/extras/tmc2660.py b/klippy/extras/tmc2660.py index 03b8c12c..8c6887ab 100644 --- a/klippy/extras/tmc2660.py +++ b/klippy/extras/tmc2660.py @@ -4,7 +4,9 @@ # Copyright (C) 2019-2021 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import math, logging +import logging +import math + from . import bus, tmc, tmc2130 Registers = { diff --git a/klippy/extras/tmc5160.py b/klippy/extras/tmc5160.py index 42161d8a..278f9cb2 100644 --- a/klippy/extras/tmc5160.py +++ b/klippy/extras/tmc5160.py @@ -3,7 +3,9 @@ # Copyright (C) 2018-2019 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import math, logging +import logging +import math + from . import bus, tmc, tmc2130 TMC_FREQUENCY = 12000000.0 diff --git a/klippy/extras/tmc_uart.py b/klippy/extras/tmc_uart.py index 141b8965..541fabdc 100644 --- a/klippy/extras/tmc_uart.py +++ b/klippy/extras/tmc_uart.py @@ -5,7 +5,6 @@ # This file may be distributed under the terms of the GNU GPLv3 license. import logging - ###################################################################### # TMC uart analog mux support ###################################################################### diff --git a/klippy/extras/tuning_tower.py b/klippy/extras/tuning_tower.py index 7d54cbb5..d15d7d1d 100644 --- a/klippy/extras/tuning_tower.py +++ b/klippy/extras/tuning_tower.py @@ -3,7 +3,8 @@ # Copyright (C) 2019 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import math, logging +import logging +import math CANCEL_Z_DELTA = 2.0 diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py index 85dd3616..0d54d244 100644 --- a/klippy/extras/virtual_sdcard.py +++ b/klippy/extras/virtual_sdcard.py @@ -3,7 +3,9 @@ # Copyright (C) 2018-2024 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. -import os, logging, io +import io +import logging +import os VALID_GCODE_EXTS = ["gcode", "g", "gco"] diff --git a/klippy/extras/z_tilt.py b/klippy/extras/z_tilt.py index f000370c..14b39fb8 100644 --- a/klippy/extras/z_tilt.py +++ b/klippy/extras/z_tilt.py @@ -4,7 +4,9 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging + import mathutil + from . import probe |