From d1148d85db80116415c400e0570267616fa02dbd Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 5 Jan 2021 17:35:10 -0800 Subject: [PATCH] A few linting fixes. --- etiquette/helpers.py | 1 - etiquette/objects.py | 5 ++--- etiquette/searchhelpers.py | 1 + frontends/etiquette_cli.py | 2 ++ utilities/database_upgrader.py | 2 -- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/etiquette/helpers.py b/etiquette/helpers.py index 7238586..4d75a4a 100644 --- a/etiquette/helpers.py +++ b/etiquette/helpers.py @@ -4,7 +4,6 @@ codebase but don't deserve to be methods of any class. ''' import datetime import hashlib -import math import mimetypes import os import PIL.Image diff --git a/etiquette/objects.py b/etiquette/objects.py index 4b4de65..3855b93 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -225,6 +225,7 @@ class GroupableMixin(metaclass=abc.ABCMeta): 'memberid': member.id, } self.photodb.sql_delete(table=self.group_table, pairs=pairs) + @abc.abstractmethod def remove_child(self, member): return self.__remove_child(member) @@ -877,7 +878,6 @@ class Photo(ObjectBase): return None return hms.seconds_to_hms(self.duration) - #@decorators.time_me @decorators.required_feature('photo.generate_thumbnail') @decorators.transaction def generate_thumbnail(self, **special): @@ -1076,7 +1076,6 @@ class Photo(ObjectBase): self.duration = probe.audio.duration - #@decorators.time_me @decorators.required_feature('photo.reload_metadata') @decorators.transaction def reload_metadata(self): @@ -1208,7 +1207,7 @@ class Photo(ObjectBase): new_path = old_path.parent.with_child(new_filename) else: new_path = pathclass.Path(new_filename) - #new_path.correct_case() + if (new_path.parent != old_path.parent) and not move: raise ValueError('Cannot move the file without param move=True.') diff --git a/etiquette/searchhelpers.py b/etiquette/searchhelpers.py index d798638..a9df8cb 100644 --- a/etiquette/searchhelpers.py +++ b/etiquette/searchhelpers.py @@ -534,6 +534,7 @@ def tag_expression_matcher_builder(frozen_children): (tag.name if not isinstance(tag, str) else tag): children for (tag, children) in frozen_children.items() } + def match_function(photo_tags, tagname): ''' Used as the `match_function` for the ExpressionTree evaluation. diff --git a/frontends/etiquette_cli.py b/frontends/etiquette_cli.py index 282bb6b..4ff08d7 100644 --- a/frontends/etiquette_cli.py +++ b/frontends/etiquette_cli.py @@ -207,6 +207,8 @@ def easybake_argparse(args): photodb = find_photodb() for eb_string in args.eb_strings: notes = photodb.easybake(eb_string) + for (action, tagname) in notes: + print(action, tagname) if args.autoyes or interactive.getpermission('Commit?'): photodb.commit() diff --git a/utilities/database_upgrader.py b/utilities/database_upgrader.py index 0509d66..74b94b3 100644 --- a/utilities/database_upgrader.py +++ b/utilities/database_upgrader.py @@ -2,8 +2,6 @@ import argparse import os import sys -from voussoirkit import sqlhelpers - import etiquette class Migrator: