From 0c83882a118e31c34045d1946ec48e642199b324 Mon Sep 17 00:00:00 2001 From: Joachim Date: Sat, 19 Jun 2021 19:44:14 +0200 Subject: [PATCH] Fix lint --- bookwyrm/imagegenerators.py | 25 +++++++++++++++++++++++++ bookwyrm/models/book.py | 7 ++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/bookwyrm/imagegenerators.py b/bookwyrm/imagegenerators.py index 31438f74f..1d065192e 100644 --- a/bookwyrm/imagegenerators.py +++ b/bookwyrm/imagegenerators.py @@ -1,74 +1,99 @@ +"""Generators for all the different thumbnail sizes""" from imagekit import ImageSpec, register from imagekit.processors import ResizeToFit class BookXSmallWebp(ImageSpec): + """Handles XSmall size in Webp format""" + processors = [ResizeToFit(80, 80)] format = "WEBP" options = {"quality": 95} class BookXSmallJpg(ImageSpec): + """Handles XSmall size in Jpeg format""" + processors = [ResizeToFit(80, 80)] format = "JPEG" options = {"quality": 95} class BookSmallWebp(ImageSpec): + """Handles Small size in Webp format""" + processors = [ResizeToFit(100, 100)] format = "WEBP" options = {"quality": 95} class BookSmallJpg(ImageSpec): + """Handles Small size in Jpeg format""" + processors = [ResizeToFit(100, 100)] format = "JPEG" options = {"quality": 95} class BookMediumWebp(ImageSpec): + """Handles Medium size in Webp format""" + processors = [ResizeToFit(150, 150)] format = "WEBP" options = {"quality": 95} class BookMediumJpg(ImageSpec): + """Handles Medium size in Jpeg format""" + processors = [ResizeToFit(150, 150)] format = "JPEG" options = {"quality": 95} class BookLargeWebp(ImageSpec): + """Handles Large size in Webp format""" + processors = [ResizeToFit(200, 200)] format = "WEBP" options = {"quality": 95} class BookLargeJpg(ImageSpec): + """Handles Large size in Jpeg format""" + processors = [ResizeToFit(200, 200)] format = "JPEG" options = {"quality": 95} class BookXLargeWebp(ImageSpec): + """Handles XLarge size in Webp format""" + processors = [ResizeToFit(250, 250)] format = "WEBP" options = {"quality": 95} class BookXLargeJpg(ImageSpec): + """Handles XLarge size in Jpeg format""" + processors = [ResizeToFit(250, 250)] format = "JPEG" options = {"quality": 95} class BookXxLargeWebp(ImageSpec): + """Handles XxLarge size in Webp format""" + processors = [ResizeToFit(500, 500)] format = "WEBP" options = {"quality": 95} class BookXxLargeJpg(ImageSpec): + """Handles XxLarge size in Jpeg format""" + processors = [ResizeToFit(500, 500)] format = "JPEG" options = {"quality": 95} diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py index 03ff572f6..189cbb897 100644 --- a/bookwyrm/models/book.py +++ b/bookwyrm/models/book.py @@ -9,7 +9,12 @@ from imagekit.models import ImageSpecField from bookwyrm import activitypub from bookwyrm.preview_images import generate_edition_preview_image_task -from bookwyrm.settings import DOMAIN, DEFAULT_LANGUAGE, ENABLE_PREVIEW_IMAGES, ENABLE_THUMBNAIL_GENERATION +from bookwyrm.settings import ( + DOMAIN, + DEFAULT_LANGUAGE, + ENABLE_PREVIEW_IMAGES, + ENABLE_THUMBNAIL_GENERATION, +) from .activitypub_mixin import OrderedCollectionPageMixin, ObjectMixin from .base_model import BookWyrmModel