better CSV file filtering

This commit is contained in:
Félix Boisselier
2024-04-29 17:50:45 +02:00
parent 56a5502d81
commit ab5600804f
4 changed files with 47 additions and 17 deletions

View File

@@ -299,8 +299,8 @@ def shaper_calibration(lognames, klipperdir='~/klipper', max_smoothing=None, scv
global shaper_calibrate
shaper_calibrate = setup_klipper_import(klipperdir)
# Parse data
datas = [parse_log(fn) for fn in lognames]
# Parse data from the log files while ignoring CSV in the wrong format
datas = [data for data in (parse_log(fn) for fn in lognames) if data is not None]
if len(datas) > 1:
print_with_c_locale('Warning: incorrect number of .csv files detected. Only the first one will be used!')