Skip to content

Commit

Permalink
[Fixed] PNGs not removed
Browse files Browse the repository at this point in the history
- For pages/layers without difference and using --only_different

Fixes #9
  • Loading branch information
set-soft committed Dec 18, 2023
1 parent c786f58 commit 72ebff2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
* Support to generate KiRi SVGs

### Fixed
* PNGs not removed when no diff and only_different was specified


## [2.4.7] - 2023-03-29
### Fixed
* The message about different page size for the red_green mode
Expand Down
6 changes: 3 additions & 3 deletions kicad-diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def DiffImages(old_file_hash, new_file_hash, layers_old, layers_new, only_differ
all_layers = {}
all_layers.update(layers_old)
all_layers.update(layers_new)
skipped = 0
skipped = []
for i in sorted(all_layers.keys()):
if svg_mode:
# Multisheet schematic
Expand Down Expand Up @@ -496,7 +496,7 @@ def DiffImages(old_file_hash, new_file_hash, layers_old, layers_new, only_differ
if inc:
files.append(diff_name)
else:
skipped = skipped+1
skipped.append(diff_name)
# Check if we skipped all
if len(files) == 1 and skipped:
files.append(create_no_diff(output_dir))
Expand Down Expand Up @@ -524,7 +524,7 @@ def DiffImages(old_file_hash, new_file_hash, layers_old, layers_new, only_differ
rename(output_pdf, out_name)
# Remove the individual PNGs
if not args.keep_pngs:
for f in files[1:-1]:
for f in files[1:-1]+skipped:
remove(f)
return out_name

Expand Down

0 comments on commit 72ebff2

Please sign in to comment.