small fixes

This commit is contained in:
classicrocker883 2025-02-24 18:22:49 -05:00
parent 137f0f830a
commit e1bd0fcb8e
2 changed files with 5 additions and 5 deletions

View file

@ -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:

View file

@ -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: