Skip to content

Commit

Permalink
paquo.images: add logging when saving image_data
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Aug 19, 2020
1 parent 51cdef2 commit cacf77e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0


## [Unreleased]
### Added
- more verbose logging when saving project data

### Fixed
- parse windows network share URIs correctly

Expand Down
10 changes: 8 additions & 2 deletions paquo/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,5 +600,11 @@ def is_changed(self) -> bool:
def save(self):
"""save image entry"""
with redirect(stdout=True, stderr=True):
if self.is_readable() and self.is_changed():
self.java_object.saveImageData(self._image_data)
if self.is_readable():
if self.is_changed():
self.java_object.saveImageData(self._image_data)
_log.info(f"Changes saved for '{self.image_name}'")
else:
_log.info(f"Saving skipped for '{self.image_name}': no changes")
else:
_log.warning(f"Saving skipped for '{self.image_name}': uri '{self.uri}' not reachable")

0 comments on commit cacf77e

Please sign in to comment.