From c27035f00d4b51328b33da09dc8862a576e6500a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 24 Oct 2017 14:29:54 +0200 Subject: [PATCH] m.images: shuffle the code around a bit. --- pelican-plugins/m/images.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pelican-plugins/m/images.py b/pelican-plugins/m/images.py index a6744218..d2e0cc77 100644 --- a/pelican-plugins/m/images.py +++ b/pelican-plugins/m/images.py @@ -42,10 +42,6 @@ except ImportError: settings = {} -def configure(pelicanobj): - settings['path'] = pelicanobj.settings.get('PATH', 'content') - pass - class Image(Directive): """Image directive @@ -177,7 +173,7 @@ class ImageGrid(rst.Directive): continue # Open the files and calculate the overall width - absuri = uri.format(filename=os.path.join(os.getcwd(), settings['path'])) + absuri = uri.format(filename=os.path.join(os.getcwd(), settings['PATH'])) im = PIL.Image.open(absuri) exif = { PIL.ExifTags.TAGS[k]: v @@ -211,6 +207,9 @@ class ImageGrid(rst.Directive): return [grid_node] +def configure(pelicanobj): + settings['PATH'] = pelicanobj.settings.get('PATH', 'content') + def register(): signals.initialized.connect(configure) -- 2.30.2