From 43f07a767de5c4ee171d81085286be5b12da8d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Ferrand?= Date: Tue, 14 May 2019 18:18:18 +0200 Subject: [PATCH 01/10] Add new plugin to allow one to disable ZIP generation on a per album basis * Heavily inspired by the '.nomedia' file --- docs/plugins.rst | 5 ++++ sigal/gallery.py | 7 ++++++ sigal/plugins/nozip_gallery.py | 45 ++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 sigal/plugins/nozip_gallery.py diff --git a/docs/plugins.rst b/docs/plugins.rst index 4074e1c..f910f67 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -119,6 +119,11 @@ Nomedia plugin .. automodule:: sigal.plugins.nomedia +No ZIP Gallery plugin +===================== + +.. automodule:: sigal.plugins.nozip_gallery + Upload to S3 plugin =================== diff --git a/sigal/gallery.py b/sigal/gallery.py index 1695852..34a94ac 100644 --- a/sigal/gallery.py +++ b/sigal/gallery.py @@ -267,6 +267,7 @@ class Album: self.settings = settings self.subdirs = dirnames self.output_file = settings['output_filename'] + self.disable_zip_gallery = False self._thumbnail = None if path == '.': @@ -527,6 +528,12 @@ class Album: archive with all original images of the corresponding directory. """ + + if self.disable_zip_gallery: + # ZIP file generation has been explicitly disabled + # by a .nozip_gallery file for instance + return + zip_gallery = self.settings['zip_gallery'] if zip_gallery and len(self) > 0: diff --git a/sigal/plugins/nozip_gallery.py b/sigal/plugins/nozip_gallery.py new file mode 100644 index 0000000..2e320c2 --- /dev/null +++ b/sigal/plugins/nozip_gallery.py @@ -0,0 +1,45 @@ +# Copyright 2019 - Remi Ferrand + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +""" This plugin offers the ability to disable ZIP gallery generation on a per album +granularity. + +To ignore a ZIP gallery generation for a particular album, put a ``.nozip_gallery`` file next to it in its parent +folder. Only the existence of this ``.nozip_gallery`` file is tested. +""" + +import logging +import os +from sigal import signals + +logger = logging.getLogger(__name__) + +def nozip_galery_file(album, settings=None): + """Filesystem based switch to disable ZIP generation for an Album""" + nozipgallerypath = os.path.join(album.src_path, ".nozip_gallery") + + if os.path.isfile(nozipgallerypath): + logger.info("Ignoring ZIP gallery generation for album '%s' because of present " + ".nozip_gallery file", album.name) + + album.disable_zip_gallery = True + +def register(settings): + signals.album_initialized.connect(nozip_galery_file) From fc14de3872a0fdf26e1c366fa7bdf287ea1ad69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Ferrand?= Date: Mon, 3 Jun 2019 22:02:37 +0200 Subject: [PATCH 02/10] Adapt zip_gallery logic to a dedicated plugin like suggested by @saimn * ZIP generation logic is now self contained in a plugin * '.nozip_gallery' file logic is now contained in the same plugin that managed the zip generation --- sigal/gallery.py | 41 ++------------- .../{nozip_gallery.py => zip_gallery.py} | 51 +++++++++++++++++-- 2 files changed, 51 insertions(+), 41 deletions(-) rename sigal/plugins/{nozip_gallery.py => zip_gallery.py} (51%) diff --git a/sigal/gallery.py b/sigal/gallery.py index 34a94ac..3943b14 100644 --- a/sigal/gallery.py +++ b/sigal/gallery.py @@ -31,7 +31,6 @@ import os import pickle import random import sys -import zipfile from click import progressbar, get_terminal_size from collections import defaultdict @@ -267,7 +266,6 @@ class Album: self.settings = settings self.subdirs = dirnames self.output_file = settings['output_filename'] - self.disable_zip_gallery = False self._thumbnail = None if path == '.': @@ -522,43 +520,10 @@ class Album: @cached_property def zip(self): - """Make a ZIP archive with all media files and return its path. - - If the ``zip_gallery`` setting is set,it contains the location of a zip - archive with all original images of the corresponding directory. - + """Placeholder ZIP method. + The ZIP logic is controlled by the zip_gallery plugin """ - - if self.disable_zip_gallery: - # ZIP file generation has been explicitly disabled - # by a .nozip_gallery file for instance - return - - zip_gallery = self.settings['zip_gallery'] - - if zip_gallery and len(self) > 0: - zip_gallery = zip_gallery.format(album=self) - archive_path = join(self.dst_path, zip_gallery) - if (self.settings.get('zip_skip_if_exists', False) and - isfile(archive_path)): - self.logger.debug("Archive %s already created, passing", - archive_path) - return zip_gallery - - archive = zipfile.ZipFile(archive_path, 'w', allowZip64=True) - attr = ('src_path' if self.settings['zip_media_format'] == 'orig' - else 'dst_path') - - for p in self: - path = getattr(p, attr) - try: - archive.write(path, os.path.split(path)[1]) - except OSError as e: - self.logger.warn('Failed to add %s to the ZIP: %s', p, e) - - archive.close() - self.logger.debug('Created ZIP archive %s', archive_path) - return zip_gallery + return None class Gallery(object): diff --git a/sigal/plugins/nozip_gallery.py b/sigal/plugins/zip_gallery.py similarity index 51% rename from sigal/plugins/nozip_gallery.py rename to sigal/plugins/zip_gallery.py index 2e320c2..42aad27 100644 --- a/sigal/plugins/nozip_gallery.py +++ b/sigal/plugins/zip_gallery.py @@ -18,8 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -""" This plugin offers the ability to disable ZIP gallery generation on a per album -granularity. +""" This plugin controls the generation of a ZIP archive for a gallery To ignore a ZIP gallery generation for a particular album, put a ``.nozip_gallery`` file next to it in its parent folder. Only the existence of this ``.nozip_gallery`` file is tested. @@ -27,19 +26,65 @@ folder. Only the existence of this ``.nozip_gallery`` file is tested. import logging import os +from os.path import isfile, join, splitext from sigal import signals +from sigal.gallery import Album +from sigal.utils import cached_property +import zipfile logger = logging.getLogger(__name__) +def noop_zip_method(album): + """A zip method that does nothing at all""" + return False + +def generate_album_zip_method(album): + """Make a ZIP archive with all media files and return its path. + + If the ``zip_gallery`` setting is set,it contains the location of a zip + archive with all original images of the corresponding directory. + + """ + + zip_gallery = album.settings['zip_gallery'] + + if zip_gallery and len(album) > 0: + zip_gallery = zip_gallery.format(album=album) + archive_path = join(album.dst_path, zip_gallery) + if (album.settings.get('zip_skip_if_exists', False) and + isfile(archive_path)): + album.logger.debug("Archive %s already created, passing", + archive_path) + return zip_gallery + + archive = zipfile.ZipFile(archive_path, 'w', allowZip64=True) + attr = ('src_path' if album.settings['zip_media_format'] == 'orig' + else 'dst_path') + + for p in album: + path = getattr(p, attr) + try: + archive.write(path, os.path.split(path)[1]) + except OSError as e: + album.logger.warn('Failed to add %s to the ZIP: %s', p, e) + + archive.close() + album.logger.debug('Created ZIP archive %s', archive_path) + return zip_gallery + + def nozip_galery_file(album, settings=None): """Filesystem based switch to disable ZIP generation for an Album""" nozipgallerypath = os.path.join(album.src_path, ".nozip_gallery") + zip_method = generate_album_zip_method + if os.path.isfile(nozipgallerypath): logger.info("Ignoring ZIP gallery generation for album '%s' because of present " ".nozip_gallery file", album.name) + zip_method = noop_zip_method - album.disable_zip_gallery = True + album.__class__.zip = cached_property(zip_method) def register(settings): signals.album_initialized.connect(nozip_galery_file) From 7952cb0e7056115a7934efb87a32f30c3aef5d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Ferrand?= Date: Wed, 5 Jun 2019 09:01:12 +0200 Subject: [PATCH 03/10] Adapt zip_gallery plugin to @saimn recommendations * One single entry point for the 'zip' property --- sigal/plugins/zip_gallery.py | 37 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/sigal/plugins/zip_gallery.py b/sigal/plugins/zip_gallery.py index 42aad27..07bbd02 100644 --- a/sigal/plugins/zip_gallery.py +++ b/sigal/plugins/zip_gallery.py @@ -34,16 +34,16 @@ import zipfile logger = logging.getLogger(__name__) -def noop_zip_method(album): - """A zip method that does nothing at all""" - return False +def _should_generate_album_zip(album): + """Checks whether a `.nozip_gallery` file exists in the album folder""" + nozipgallerypath = os.path.join(album.src_path, ".nozip_gallery") + return not os.path.isfile(nozipgallerypath) -def generate_album_zip_method(album): +def _generate_album_zip(album): """Make a ZIP archive with all media files and return its path. If the ``zip_gallery`` setting is set,it contains the location of a zip archive with all original images of the corresponding directory. - """ zip_gallery = album.settings['zip_gallery'] @@ -72,19 +72,28 @@ def generate_album_zip_method(album): album.logger.debug('Created ZIP archive %s', archive_path) return zip_gallery + return False -def nozip_galery_file(album, settings=None): - """Filesystem based switch to disable ZIP generation for an Album""" - nozipgallerypath = os.path.join(album.src_path, ".nozip_gallery") +def generate_album_zip(album): + """Checks for .nozip_gallery file in album folder. + If this file exists, no ZIP archive is generated. + If the file is absent, make a ZIP archive with all media files and return its path. - zip_method = generate_album_zip_method + If the ``zip_gallery`` setting is set,it contains the location of a zip + archive with all original images of the corresponding directory. + """ - if os.path.isfile(nozipgallerypath): - logger.info("Ignoring ZIP gallery generation for album '%s' because of present " - ".nozip_gallery file", album.name) - zip_method = noop_zip_method + # check if ZIP file generation as been disabled by .nozip_gallery file + if not _should_generate_album_zip(album): + album.logger.info("Ignoring ZIP gallery generation for album '%s' because of present " + ".nozip_gallery file", album.name) + return False - album.__class__.zip = cached_property(zip_method) + return _generate_album_zip(album) + +def nozip_galery_file(album, settings=None): + """Filesystem based switch to disable ZIP generation for an Album""" + Album.zip = cached_property(generate_album_zip) def register(settings): signals.album_initialized.connect(nozip_galery_file) From fd51aedec9cdb689f8e9306a07eacf65a01a9eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Ferrand?= Date: Wed, 5 Jun 2019 09:04:25 +0200 Subject: [PATCH 04/10] Adapt docstring for the zip_gallery plugin as suggested by @saimn --- sigal/plugins/zip_gallery.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sigal/plugins/zip_gallery.py b/sigal/plugins/zip_gallery.py index 07bbd02..350dfeb 100644 --- a/sigal/plugins/zip_gallery.py +++ b/sigal/plugins/zip_gallery.py @@ -22,6 +22,10 @@ To ignore a ZIP gallery generation for a particular album, put a ``.nozip_gallery`` file next to it in its parent folder. Only the existence of this ``.nozip_gallery`` file is tested. +If no .nozip_fallery file is present, then make a ZIP archive with all media files. + +If the ``zip_gallery`` setting is set,it contains the location of a zip +archive with all original images of the corresponding directory. """ import logging From cd1d5e9d2a29bbe5f00cb3c2e8372be0048df082 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Mon, 26 Aug 2019 00:53:34 +0200 Subject: [PATCH 05/10] Fix api link --- docs/plugins.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index f910f67..70aac40 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -119,10 +119,10 @@ Nomedia plugin .. automodule:: sigal.plugins.nomedia -No ZIP Gallery plugin -===================== +ZIP Gallery plugin +================== -.. automodule:: sigal.plugins.nozip_gallery +.. automodule:: sigal.plugins.zip_gallery Upload to S3 plugin =================== From 98e1018b178a47daaf3816403080b54bcada91f9 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Mon, 26 Aug 2019 00:54:01 +0200 Subject: [PATCH 06/10] Fix typo and use the module logger --- sigal/plugins/zip_gallery.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sigal/plugins/zip_gallery.py b/sigal/plugins/zip_gallery.py index 350dfeb..7c5a34b 100644 --- a/sigal/plugins/zip_gallery.py +++ b/sigal/plugins/zip_gallery.py @@ -20,9 +20,10 @@ """ This plugin controls the generation of a ZIP archive for a gallery -To ignore a ZIP gallery generation for a particular album, put a ``.nozip_gallery`` file next to it in its parent -folder. Only the existence of this ``.nozip_gallery`` file is tested. -If no .nozip_fallery file is present, then make a ZIP archive with all media files. +To ignore a ZIP gallery generation for a particular album, put +a ``.nozip_gallery`` file next to it in its parent folder. Only the existence +of this ``.nozip_gallery`` file is tested. If no .nozip_fallery file is +present, then make a ZIP archive with all media files. If the ``zip_gallery`` setting is set,it contains the location of a zip archive with all original images of the corresponding directory. @@ -57,8 +58,7 @@ def _generate_album_zip(album): archive_path = join(album.dst_path, zip_gallery) if (album.settings.get('zip_skip_if_exists', False) and isfile(archive_path)): - album.logger.debug("Archive %s already created, passing", - archive_path) + logger.debug("Archive %s already created, passing", archive_path) return zip_gallery archive = zipfile.ZipFile(archive_path, 'w', allowZip64=True) @@ -70,10 +70,10 @@ def _generate_album_zip(album): try: archive.write(path, os.path.split(path)[1]) except OSError as e: - album.logger.warn('Failed to add %s to the ZIP: %s', p, e) + logger.warn('Failed to add %s to the ZIP: %s', p, e) archive.close() - album.logger.debug('Created ZIP archive %s', archive_path) + logger.debug('Created ZIP archive %s', archive_path) return zip_gallery return False @@ -89,15 +89,15 @@ def generate_album_zip(album): # check if ZIP file generation as been disabled by .nozip_gallery file if not _should_generate_album_zip(album): - album.logger.info("Ignoring ZIP gallery generation for album '%s' because of present " - ".nozip_gallery file", album.name) + logger.info("Ignoring ZIP gallery generation for album '%s' because of present " + ".nozip_gallery file", album.name) return False return _generate_album_zip(album) -def nozip_galery_file(album, settings=None): +def nozip_gallery_file(album, settings=None): """Filesystem based switch to disable ZIP generation for an Album""" Album.zip = cached_property(generate_album_zip) def register(settings): - signals.album_initialized.connect(nozip_galery_file) + signals.album_initialized.connect(nozip_gallery_file) From bcf4b82d05f26ed699556c5f0f55d07e97e3410f Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Mon, 26 Aug 2019 00:54:29 +0200 Subject: [PATCH 07/10] Activate the zip_gallery plugin for tests --- tests/sample/sigal.conf.py | 12 +++++++++--- tests/test_zip.py | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/sample/sigal.conf.py b/tests/sample/sigal.conf.py index cbf4ac1..34e5d24 100644 --- a/tests/sample/sigal.conf.py +++ b/tests/sample/sigal.conf.py @@ -9,9 +9,15 @@ links = [('Example link', 'http://example.org'), files_to_copy = (('../watermark.png', 'watermark.png'),) -plugins = ['sigal.plugins.adjust', 'sigal.plugins.copyright', - 'sigal.plugins.watermark', 'sigal.plugins.feeds', - 'sigal.plugins.nomedia', 'sigal.plugins.extended_caching'] +plugins = [ + 'sigal.plugins.adjust', + 'sigal.plugins.copyright', + 'sigal.plugins.extended_caching' + 'sigal.plugins.feeds', + 'sigal.plugins.nomedia', + 'sigal.plugins.watermark', + 'sigal.plugins.zip_gallery', +] copyright = '© An example copyright message' adjust_options = {'color': 0.9, 'brightness': 1.0, 'contrast': 1.0, 'sharpness': 0.0} diff --git a/tests/test_zip.py b/tests/test_zip.py index 0065133..290b05d 100644 --- a/tests/test_zip.py +++ b/tests/test_zip.py @@ -2,6 +2,7 @@ import os import glob import zipfile +from sigal import init_plugins from sigal.gallery import Gallery from sigal.settings import read_settings @@ -15,6 +16,7 @@ def make_gallery(**kwargs): settings = read_settings(default_conf) settings['source'] = SAMPLE_SOURCE settings.update(kwargs) + init_plugins(settings) return Gallery(settings, ncpu=1) From 2677cba65525c165e85fef6ec94fd95931c2b3c0 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Mon, 26 Aug 2019 01:05:27 +0200 Subject: [PATCH 08/10] Add test for .nozip_gallery --- sigal/plugins/zip_gallery.py | 2 +- tests/test_zip.py | 37 ++++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/sigal/plugins/zip_gallery.py b/sigal/plugins/zip_gallery.py index 7c5a34b..997505a 100644 --- a/sigal/plugins/zip_gallery.py +++ b/sigal/plugins/zip_gallery.py @@ -22,7 +22,7 @@ To ignore a ZIP gallery generation for a particular album, put a ``.nozip_gallery`` file next to it in its parent folder. Only the existence -of this ``.nozip_gallery`` file is tested. If no .nozip_fallery file is +of this ``.nozip_gallery`` file is tested. If no .nozip_gallery file is present, then make a ZIP archive with all media files. If the ``zip_gallery`` setting is set,it contains the location of a zip diff --git a/tests/test_zip.py b/tests/test_zip.py index 290b05d..57e6522 100644 --- a/tests/test_zip.py +++ b/tests/test_zip.py @@ -8,13 +8,13 @@ from sigal.settings import read_settings CURRENT_DIR = os.path.dirname(__file__) SAMPLE_DIR = os.path.join(CURRENT_DIR, 'sample') -SAMPLE_SOURCE = os.path.join(SAMPLE_DIR, 'pictures', 'dir1') +SAMPLE_SOURCE = os.path.join(SAMPLE_DIR, 'pictures') -def make_gallery(**kwargs): +def make_gallery(source_dir='dir1', **kwargs): default_conf = os.path.join(SAMPLE_DIR, 'sigal.conf.py') settings = read_settings(default_conf) - settings['source'] = SAMPLE_SOURCE + settings['source'] = os.path.join(SAMPLE_SOURCE, source_dir) settings.update(kwargs) init_plugins(settings) return Gallery(settings, ncpu=1) @@ -22,15 +22,13 @@ def make_gallery(**kwargs): def test_zipped_correctly(tmpdir): outpath = str(tmpdir) - gallery = make_gallery(destination=outpath, - zip_gallery='archive.zip') + gallery = make_gallery(destination=outpath, zip_gallery='archive.zip') gallery.build() - zipped1 = glob.glob(os.path.join(outpath, 'test1', '*.zip')) - assert len(zipped1) == 1 - assert os.path.basename(zipped1[0]) == 'archive.zip' + zipf = os.path.join(outpath, 'test1', 'archive.zip') + assert os.path.isfile(zipf) - zip_file = zipfile.ZipFile(zipped1[0], 'r') + zip_file = zipfile.ZipFile(zipf, 'r') expected = ('11.jpg', 'CMB_Timeline300_no_WMAP.jpg', 'flickr_jerquiaga_2394751088_cc-by-nc.jpg', 'example.gif') @@ -40,16 +38,23 @@ def test_zipped_correctly(tmpdir): zip_file.close() - zipped2 = glob.glob(os.path.join(outpath, 'test2', '*.zip')) - assert len(zipped2) == 1 - assert os.path.basename(zipped2[0]) == 'archive.zip' + assert os.path.isfile(os.path.join(outpath, 'test2', 'archive.zip')) + + +def test_not_zipped(tmpdir): + # test that the zip file is not created when the .nozip_gallery file + # is present + outpath = str(tmpdir) + gallery = make_gallery(destination=outpath, zip_gallery='archive.zip', + source_dir='dir2') + gallery.build() + assert not os.path.isfile(os.path.join(outpath, 'archive.zip')) def test_no_archive(tmpdir): outpath = str(tmpdir) - gallery = make_gallery(destination=outpath, - zip_gallery=False) + gallery = make_gallery(destination=outpath, zip_gallery=False) gallery.build() - assert not glob.glob(os.path.join(outpath, 'test1', '*.zip')) - assert not glob.glob(os.path.join(outpath, 'test2', '*.zip')) + assert not os.path.isfile(os.path.join(outpath, 'test1', 'archive.zip')) + assert not os.path.isfile(os.path.join(outpath, 'test2', 'archive.zip')) From 1d79e3f7a5ae6ef565e21290dbb107ab64f9b174 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Mon, 26 Aug 2019 01:14:01 +0200 Subject: [PATCH 09/10] Forgot to add file for the test --- tests/sample/pictures/dir2/.nozip_gallery | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/sample/pictures/dir2/.nozip_gallery diff --git a/tests/sample/pictures/dir2/.nozip_gallery b/tests/sample/pictures/dir2/.nozip_gallery new file mode 100644 index 0000000..e69de29 From a3bf898c4d5052a8e7fbc0a429b95442803bce36 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Mon, 26 Aug 2019 01:14:15 +0200 Subject: [PATCH 10/10] Improve docs --- docs/plugins.rst | 12 +++++++----- sigal/plugins/zip_gallery.py | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 70aac40..4da49dc 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -2,6 +2,8 @@ Plugins ========= +.. contents:: + How to use plugins ------------------ @@ -119,11 +121,6 @@ Nomedia plugin .. automodule:: sigal.plugins.nomedia -ZIP Gallery plugin -================== - -.. automodule:: sigal.plugins.zip_gallery - Upload to S3 plugin =================== @@ -133,3 +130,8 @@ Watermark plugin ================ .. automodule:: sigal.plugins.watermark + +ZIP Gallery plugin +================== + +.. automodule:: sigal.plugins.zip_gallery diff --git a/sigal/plugins/zip_gallery.py b/sigal/plugins/zip_gallery.py index 997505a..c5808cc 100644 --- a/sigal/plugins/zip_gallery.py +++ b/sigal/plugins/zip_gallery.py @@ -20,13 +20,13 @@ """ This plugin controls the generation of a ZIP archive for a gallery +If the ``zip_gallery`` setting is set, it contains the location of a zip +archive with all original images of the corresponding directory. + To ignore a ZIP gallery generation for a particular album, put a ``.nozip_gallery`` file next to it in its parent folder. Only the existence -of this ``.nozip_gallery`` file is tested. If no .nozip_gallery file is +of this ``.nozip_gallery`` file is tested. If no ``.nozip_gallery`` file is present, then make a ZIP archive with all media files. - -If the ``zip_gallery`` setting is set,it contains the location of a zip -archive with all original images of the corresponding directory. """ import logging