From e1bd0fcb8e83dc006a03f54a362c36a497246647 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 24 Feb 2025 18:22:49 -0500 Subject: [PATCH] small fixes --- buildroot/share/PlatformIO/scripts/schema.py | 4 ++-- buildroot/share/scripts/g29_auto.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/schema.py b/buildroot/share/PlatformIO/scripts/schema.py index 8cdb2c7561..0f0a5d83d8 100755 --- a/buildroot/share/PlatformIO/scripts/schema.py +++ b/buildroot/share/PlatformIO/scripts/schema.py @@ -329,9 +329,9 @@ def extract_files(filekey): elif cparts[0] == '#if': conditions.append([atomize(line[3:].strip())]) elif cparts[0] == '#ifdef': - conditions.append([ f'defined({line[6:].strip()})' ]) + conditions.append([f'defined({line[6:].strip()})']) elif cparts[0] == '#ifndef': - conditions.append([ f'!defined({line[7:].strip()})' ]) + conditions.append([f'!defined({line[7:].strip()})']) # Handle a complete #define line elif defmatch is not None: diff --git a/buildroot/share/scripts/g29_auto.py b/buildroot/share/scripts/g29_auto.py index b864223804..c2ae21b95c 100755 --- a/buildroot/share/scripts/g29_auto.py +++ b/buildroot/share/scripts/g29_auto.py @@ -110,9 +110,9 @@ def z_parse(gcode, start_at_line=0, end_at_line=0): result = find_z(gcode, i + 1) if result is None: - break # Exit loop if find_z() returns None + break - z, i = result # Now safe to unpack + z, i = result all_z.append(z) z_at_line.append(i) @@ -183,7 +183,7 @@ new_command = 'G29 L{0} R{1} F{2} B{3} P{4}\n'.format(min_x, with open(input_file, 'r') as in_file, open(output_file, 'w') as out_file: for line in in_file: - if line.strip().upper().startswith(g29_keyword): # Improved condition + if line.strip().upper().startswith(g29_keyword): out_file.write(new_command) print("write G29") else: