Skip to content

Commit

Permalink
lint fixes;
Browse files Browse the repository at this point in the history
  • Loading branch information
twiddli committed Mar 15, 2018
1 parent f63233a commit 74fe29f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions happypanda/core/commands/gallery_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _calculate(self, gallery_or_id, all_gallery_tags={}):
g_tags = all_gallery_tags[g_id]
for a, b in g_tags.items():
tag_count += len(b)
self.set_max_progress(len(g_tags)+3)
self.set_max_progress(len(g_tags) + 3)
else:
if isinstance(gallery_or_id, db.Gallery):
g_tags = gallery_or_id
Expand All @@ -117,7 +117,8 @@ def _calculate(self, gallery_or_id, all_gallery_tags={}):
data[g_id] = gl_data = {}
update_dict = not all_gallery_tags
max_prog = 3
for t_id, t in all_gallery_tags.items() or constants.db_session().query(db.Gallery.id, db.Taggable).join(db.Gallery.taggable):
for t_id, t in all_gallery_tags.items() or constants.db_session().query(
db.Gallery.id, db.Taggable).join(db.Gallery.taggable):
self.next_progress()
if update_dict:
all_gallery_tags[t_id] = t.compact_tags(t.tags.all())
Expand Down
2 changes: 0 additions & 2 deletions happypanda/core/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,6 @@ class Taggable(UpdatedMixin, Base):
secondary=taggable_tags,
lazy="dynamic")


def compact_tags(self, tags):
c_tags = {}
for t in tags:
Expand Down Expand Up @@ -889,7 +888,6 @@ def tags(self):
compact_tags = Taggable.compact_tags



@generic_repr
class AliasName(NameMixin, AliasMixin, Base):
__tablename__ = 'aliasname'
Expand Down

0 comments on commit 74fe29f

Please sign in to comment.