From 0160af57ddfbfda4eb55b0bf8461ac75f45fe313 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 16 Dec 2016 19:08:34 -0800 Subject: [PATCH] Fix bugs from moving variables --- helpers.py | 2 +- phototagger.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/helpers.py b/helpers.py index 0eb5afa..9d006f0 100644 --- a/helpers.py +++ b/helpers.py @@ -262,7 +262,7 @@ def _setify_tags(photodb, tags, warn_bad_tags=False): try: tag = photodb.get_tag(tag) tagset.add(tag) - except NoSuchTag: + except exceptions.NoSuchTag: if warn_bad_tags: warnings.warn(constants.WARNING_NO_SUCH_TAG.format(tag=tag)) continue diff --git a/phototagger.py b/phototagger.py index 3b7e59f..0370222 100644 --- a/phototagger.py +++ b/phototagger.py @@ -1759,8 +1759,8 @@ class Photo(ObjectBase): (new_width, new_height) = helpers.fit_into_bounds( image_width=width, image_height=height, - frame_width=self.config['thumbnail_width'], - frame_height=self.config['thumbnail_height'], + frame_width=self.photodb.config['thumbnail_width'], + frame_height=self.photodb.config['thumbnail_height'], ) if new_width < width: image = image.resize((new_width, new_height)) @@ -1775,8 +1775,8 @@ class Photo(ObjectBase): size = helpers.fit_into_bounds( image_width=probe.video.video_width, image_height=probe.video.video_height, - frame_width=self.config['thumbnail_width'], - frame_height=self.config['thumbnail_height'], + frame_width=self.photodb.config['thumbnail_width'], + frame_height=self.photodb.config['thumbnail_height'], ) size = '%dx%d' % size duration = probe.video.duration @@ -1997,6 +1997,9 @@ class Tag(ObjectBase, GroupableMixin): self.group_getter = self.photodb.get_tag self._cached_qualified_name = None + def __eq__(self, other): + return self.name == other or ObjectBase.__eq__(self, other) + def __hash__(self): return hash(self.name)