mirror of
https://github.com/enpaul/kodak.git
synced 2024-11-14 10:36:55 +00:00
Fix typing and linting errors
Fix typing error in checksum path factory Fix immediate reraise in manip resource handler Fix unsilenced warning in manip protocol function
This commit is contained in:
parent
ade6929dc3
commit
0bf2aba0ba
@ -47,7 +47,7 @@ class Checksum(NamedTuple):
|
||||
|
||||
hasher = constructor()
|
||||
view = memoryview(bytearray(1024 * 1024))
|
||||
with path.open("rb", buffering=0) as infile:
|
||||
with Path(path).open("rb", buffering=0) as infile:
|
||||
for chunk in iter(lambda: infile.readinto(view), 0): # type: ignore
|
||||
hasher.update(view[:chunk])
|
||||
|
||||
|
@ -98,7 +98,8 @@ def crop(image: Image.Image, config: configuration.ManipConfig) -> Image.Image:
|
||||
|
||||
|
||||
def black_and_white(
|
||||
image: Image.Image, config: configuration.ManipConfig
|
||||
image: Image.Image,
|
||||
config: configuration.ManipConfig, # pylint: disable=unused-argument
|
||||
) -> Image.Image:
|
||||
"""Convert an image to full-depth black and white"""
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -24,7 +24,7 @@ class ImageManip(KodakResource):
|
||||
manip_config = flask.current_app.appconfig.manips[manip_name]
|
||||
format_ = constants.ImageFormat[format_name.upper()]
|
||||
except KeyError:
|
||||
raise
|
||||
raise RuntimeError("Manip or format doesn't exist") from None
|
||||
|
||||
with database.interface.atomic():
|
||||
parent = database.ImageRecord.get(database.ImageRecord.name == image_name)
|
||||
|
Loading…
Reference in New Issue
Block a user