Cleanup some pylint
This commit is contained in:
parent
dcb946f3df
commit
b69ef8ea00
4 changed files with 10 additions and 16 deletions
|
@ -29,7 +29,7 @@ def album_zip_directories(album, recursive=True):
|
||||||
child_directory = os.path.join(root_folder, child_directory)
|
child_directory = os.path.join(root_folder, child_directory)
|
||||||
directories[child_album] = child_directory
|
directories[child_album] = child_directory
|
||||||
return directories
|
return directories
|
||||||
|
|
||||||
def album_zip_filenames(album, recursive=True):
|
def album_zip_filenames(album, recursive=True):
|
||||||
'''
|
'''
|
||||||
Given an album, produce a dictionary mapping local filepaths to the
|
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):
|
elif all(c in '0123456789.' for c in value):
|
||||||
return float(value)
|
return float(value)
|
||||||
else:
|
else:
|
||||||
return bytestring.parsebytes(value)
|
return bytestring.parsebytes(value)
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import flask
|
import flask
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from . import helpers
|
|
||||||
|
|
||||||
def make_json_response(j, *args, **kwargs):
|
def make_json_response(j, *args, **kwargs):
|
||||||
dumped = json.dumps(j)
|
dumped = json.dumps(j)
|
||||||
response = flask.Response(dumped, *args, **kwargs)
|
response = flask.Response(dumped, *args, **kwargs)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import bcrypt
|
import bcrypt
|
||||||
import collections
|
|
||||||
import copy
|
import copy
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
@ -19,7 +18,6 @@ from . import searchhelpers
|
||||||
from voussoirkit import cacheclass
|
from voussoirkit import cacheclass
|
||||||
from voussoirkit import expressionmatch
|
from voussoirkit import expressionmatch
|
||||||
from voussoirkit import pathclass
|
from voussoirkit import pathclass
|
||||||
from voussoirkit import safeprint
|
|
||||||
from voussoirkit import spinal
|
from voussoirkit import spinal
|
||||||
|
|
||||||
|
|
||||||
|
@ -664,7 +662,7 @@ class PDBPhotoMixin:
|
||||||
tag_musts = None
|
tag_musts = None
|
||||||
tag_mays = None
|
tag_mays = None
|
||||||
tag_forbids = None
|
tag_forbids = None
|
||||||
tag_expression = None
|
tag_expression = None
|
||||||
else:
|
else:
|
||||||
_helper = lambda tagset: searchhelpers.normalize_tag_mmf(
|
_helper = lambda tagset: searchhelpers.normalize_tag_mmf(
|
||||||
photodb=self,
|
photodb=self,
|
||||||
|
@ -827,15 +825,15 @@ class PDBPhotoMixin:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if any(
|
if any(
|
||||||
not fetch[constants.SQL_PHOTO[key]] or
|
not fetch[constants.SQL_PHOTO[key]] or fetch[constants.SQL_PHOTO[key]] > value
|
||||||
fetch[constants.SQL_PHOTO[key]] > value for (key, value) in maximums.items()
|
for (key, value) in maximums.items()
|
||||||
):
|
):
|
||||||
#print('Failed maximums')
|
#print('Failed maximums')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if any(
|
if any(
|
||||||
not fetch[constants.SQL_PHOTO[key]] or
|
not fetch[constants.SQL_PHOTO[key]] or fetch[constants.SQL_PHOTO[key]] < value
|
||||||
fetch[constants.SQL_PHOTO[key]] < value for (key, value) in minimums.items()
|
for (key, value) in minimums.items()
|
||||||
):
|
):
|
||||||
#print('Failed minimums')
|
#print('Failed minimums')
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import shlex
|
|
||||||
|
|
||||||
from . import constants
|
from . import constants
|
||||||
from . import exceptions
|
from . import exceptions
|
||||||
from . import helpers
|
from . import helpers
|
||||||
|
@ -186,7 +184,7 @@ def normalize_limit(limit, warning_bag=None):
|
||||||
limit = int(limit)
|
limit = int(limit)
|
||||||
|
|
||||||
if not isinstance(limit, int):
|
if not isinstance(limit, int):
|
||||||
message = 'Invalid limit "%s%"' % limit
|
message = 'Invalid limit "%s"' % limit
|
||||||
if warning_bag:
|
if warning_bag:
|
||||||
warning_bag.add(message)
|
warning_bag.add(message)
|
||||||
limit = None
|
limit = None
|
||||||
|
@ -208,7 +206,7 @@ def normalize_offset(offset, warning_bag=None):
|
||||||
offset = int(offset)
|
offset = int(offset)
|
||||||
|
|
||||||
if not isinstance(offset, int):
|
if not isinstance(offset, int):
|
||||||
message = 'Invalid offset "%s%"' % offset
|
message = 'Invalid offset "%s"' % offset
|
||||||
if warning_bag:
|
if warning_bag:
|
||||||
warning_bag.add(message)
|
warning_bag.add(message)
|
||||||
offset = None
|
offset = None
|
||||||
|
@ -269,7 +267,7 @@ def normalize_orderby(orderby, warning_bag=None):
|
||||||
if warning_bag:
|
if warning_bag:
|
||||||
warning_bag.add(message)
|
warning_bag.add(message)
|
||||||
else:
|
else:
|
||||||
raise ValueError(message)
|
raise ValueError(message)
|
||||||
direction = 'desc'
|
direction = 'desc'
|
||||||
|
|
||||||
requested_order = '%s-%s' % (column, direction)
|
requested_order = '%s-%s' % (column, direction)
|
||||||
|
|
Loading…
Reference in a new issue