From b69ef8ea00c7e4d0d2534aed4074fbf01bbc9030 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 23 Mar 2017 15:11:28 -0700 Subject: [PATCH] Cleanup some pylint --- etiquette/helpers.py | 4 ++-- etiquette/jsonify.py | 2 -- etiquette/photodb.py | 12 +++++------- etiquette/searchhelpers.py | 8 +++----- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/etiquette/helpers.py b/etiquette/helpers.py index 02b5d61..a348f6f 100644 --- a/etiquette/helpers.py +++ b/etiquette/helpers.py @@ -29,7 +29,7 @@ def album_zip_directories(album, recursive=True): child_directory = os.path.join(root_folder, child_directory) directories[child_album] = child_directory return directories - + def album_zip_filenames(album, recursive=True): ''' Given an album, produce a dictionary mapping local filepaths to the @@ -351,4 +351,4 @@ def _unitconvert(value): elif all(c in '0123456789.' for c in value): return float(value) else: - return bytestring.parsebytes(value) \ No newline at end of file + return bytestring.parsebytes(value) diff --git a/etiquette/jsonify.py b/etiquette/jsonify.py index 9f3b890..a3ac0a2 100644 --- a/etiquette/jsonify.py +++ b/etiquette/jsonify.py @@ -1,8 +1,6 @@ import flask import json -from . import helpers - def make_json_response(j, *args, **kwargs): dumped = json.dumps(j) response = flask.Response(dumped, *args, **kwargs) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index f3b525a..2e2c58d 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -1,5 +1,4 @@ import bcrypt -import collections import copy import json import logging @@ -19,7 +18,6 @@ from . import searchhelpers from voussoirkit import cacheclass from voussoirkit import expressionmatch from voussoirkit import pathclass -from voussoirkit import safeprint from voussoirkit import spinal @@ -664,7 +662,7 @@ class PDBPhotoMixin: tag_musts = None tag_mays = None tag_forbids = None - tag_expression = None + tag_expression = None else: _helper = lambda tagset: searchhelpers.normalize_tag_mmf( photodb=self, @@ -827,15 +825,15 @@ class PDBPhotoMixin: continue if any( - not fetch[constants.SQL_PHOTO[key]] or - fetch[constants.SQL_PHOTO[key]] > value for (key, value) in maximums.items() + not fetch[constants.SQL_PHOTO[key]] or fetch[constants.SQL_PHOTO[key]] > value + for (key, value) in maximums.items() ): #print('Failed maximums') continue if any( - not fetch[constants.SQL_PHOTO[key]] or - fetch[constants.SQL_PHOTO[key]] < value for (key, value) in minimums.items() + not fetch[constants.SQL_PHOTO[key]] or fetch[constants.SQL_PHOTO[key]] < value + for (key, value) in minimums.items() ): #print('Failed minimums') continue diff --git a/etiquette/searchhelpers.py b/etiquette/searchhelpers.py index c1b835a..eb6b299 100644 --- a/etiquette/searchhelpers.py +++ b/etiquette/searchhelpers.py @@ -1,5 +1,3 @@ -import shlex - from . import constants from . import exceptions from . import helpers @@ -186,7 +184,7 @@ def normalize_limit(limit, warning_bag=None): limit = int(limit) if not isinstance(limit, int): - message = 'Invalid limit "%s%"' % limit + message = 'Invalid limit "%s"' % limit if warning_bag: warning_bag.add(message) limit = None @@ -208,7 +206,7 @@ def normalize_offset(offset, warning_bag=None): offset = int(offset) if not isinstance(offset, int): - message = 'Invalid offset "%s%"' % offset + message = 'Invalid offset "%s"' % offset if warning_bag: warning_bag.add(message) offset = None @@ -269,7 +267,7 @@ def normalize_orderby(orderby, warning_bag=None): if warning_bag: warning_bag.add(message) else: - raise ValueError(message) + raise ValueError(message) direction = 'desc' requested_order = '%s-%s' % (column, direction)