chiark / gitweb /
m.images: shuffle the code around a bit.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 24 Oct 2017 12:29:54 +0000 (14:29 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 24 Oct 2017 12:29:54 +0000 (14:29 +0200)
pelican-plugins/m/images.py

index a67442188141f486fc09ff41657ba967b2aad762..d2e0cc77d109740532c717089f029a5554486880 100644 (file)
@@ -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)