From a8e996e66072e94de93fd4ea78a456bc61831f52 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Sun, 21 Jun 2020 12:06:25 -0700 Subject: [PATCH] Minor refactoring in photoinfo.py --- osxphotos/_version.py | 2 +- osxphotos/photoinfo/photoinfo.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/osxphotos/_version.py b/osxphotos/_version.py index aa59d0b0..2beff064 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,3 +1,3 @@ """ version info """ -__version__ = "0.29.26" +__version__ = "0.29.27" diff --git a/osxphotos/photoinfo/photoinfo.py b/osxphotos/photoinfo/photoinfo.py index 61e5f114..6c725f59 100644 --- a/osxphotos/photoinfo/photoinfo.py +++ b/osxphotos/photoinfo/photoinfo.py @@ -69,6 +69,7 @@ class PhotoInfo: @property def filename(self): """ filename of the picture """ + # sourcery off if self.has_raw and self.raw_original: # return name of the RAW file # TODO: not yet implemented @@ -89,8 +90,7 @@ class PhotoInfo: seconds = self._info["imageTimeZoneOffsetSeconds"] or 0 delta = timedelta(seconds=seconds) tz = timezone(delta) - imagedate_utc = imagedate.astimezone(tz=tz) - return imagedate_utc + return imagedate.astimezone(tz=tz) @property def date_modified(self): @@ -101,8 +101,7 @@ class PhotoInfo: seconds = self._info["imageTimeZoneOffsetSeconds"] or 0 delta = timedelta(seconds=seconds) tz = timezone(delta) - imagedate_utc = imagedate.astimezone(tz=tz) - return imagedate_utc + return imagedate.astimezone(tz=tz) else: return None @@ -494,12 +493,11 @@ class PhotoInfo: self is not included in the returned list """ if self._info["burst"]: burst_uuid = self._info["burstUUID"] - burst_photos = [ + return [ PhotoInfo(db=self._db, uuid=u, info=self._db._dbphotos[u]) for u in self._db._dbphotos_burst[burst_uuid] if u != self._uuid ] - return burst_photos else: return []