From 3fef17e3fc277c1cd724d051b8cb08a874f24069 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Fri, 8 Apr 2022 20:05:51 +0200 Subject: [PATCH] Format --- docs/changelog.rst | 2 +- sigal/utils.py | 2 +- tests/test_extended_caching.py | 11 +++++++++-- tests/test_image.py | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 34c6a61..21b92f2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -23,7 +23,7 @@ Sigal now requires Python 3.8+. the galleria theme [:issue:`450`]. - Fix loading ``filters.py`` [:issue:`452`]. - Fix compatibility with Click 8.1. -- colorbox theme: avoiding holes due to non image/video files present in the +- colorbox theme: avoiding holes due to non image/video files present in the source directory [:issue:`455`]. - Extend caching plugin to handle markdown and iptc metadata [:issue:`443`]. diff --git a/sigal/utils.py b/sigal/utils.py index a374758..402ace3 100644 --- a/sigal/utils.py +++ b/sigal/utils.py @@ -18,9 +18,9 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -from functools import lru_cache import os import shutil +from functools import lru_cache from urllib.parse import quote from markdown import Markdown diff --git a/tests/test_extended_caching.py b/tests/test_extended_caching.py index f1a2cc5..537c0cf 100644 --- a/tests/test_extended_caching.py +++ b/tests/test_extended_caching.py @@ -109,10 +109,17 @@ def test_load_metadata_missing(settings, tmpdir): # set mod_date to -1 to force cache update gal.metadataCache = { - "exifTest/_index": {"mod_date": -1,}, + "exifTest/_index": { + "mod_date": -1, + }, "exifTest/21.jpg": {"exif": "Foo", "mod_date": -1}, "exifTest/foooo.jpg": {"exif": "Foo"}, - "dir1/test2/22.jpg": {"exif": "Bar", "mod_date": 100000000000, "meta_mod_date": -1, "markdown_metadata": "Bar"}, + "dir1/test2/22.jpg": { + "exif": "Bar", + "mod_date": 100000000000, + "meta_mod_date": -1, + "markdown_metadata": "Bar", + }, } # errors should all be caught extended_caching.load_metadata(gal.albums["exifTest"]) diff --git a/tests/test_image.py b/tests/test_image.py index 2a5d3b5..093959c 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -11,8 +11,8 @@ from sigal.image import ( generate_thumbnail, get_exif_data, get_exif_tags, - get_iptc_data, get_image_metadata, + get_iptc_data, get_size, process_image, )