Skip to content

Commit

Permalink
Update E3S1PROFORKBYTT_prusa_v27_thumbnail.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasToka authored Dec 1, 2023
1 parent 6de6fbd commit 733d72c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions E3S1PROFORKBYTT_prusa_v27_thumbnail.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def main(source_file):
lines = [line for line in lines if not line.strip() == ';' and not line.strip() == '']
thumbnail_jpg_index = next((i for i, line in enumerate(lines) if line.startswith('; thumbnail_JPG begin')), None)

if thumbnail_jpg_index is not None:
# Check and remove the specific line if it exists right before the thumbnail JPG line
if thumbnail_jpg_index > 0 and lines[thumbnail_jpg_index - 1].strip() == '; generated by PrusaSlicer 2.7.0+win64 on 2023-12-01 at 23:07:58 UTC':
if thumbnail_jpg_index is not None and thumbnail_jpg_index > 0:
# Check and remove the specific line if it starts with '; generated by PrusaSlicer'
if lines[thumbnail_jpg_index - 1].startswith('; generated by PrusaSlicer'):
del lines[thumbnail_jpg_index - 1]

# Now we remove the newline before the '; thumbnail_JPG begin', if present
Expand All @@ -82,4 +82,4 @@ def main(source_file):
print("Usage: python3 script.py <gcode-file>")
sys.exit(1)

main(sys.argv[1])
main(sys.argv[1])

0 comments on commit 733d72c

Please sign in to comment.