chiark / gitweb /
m.images: make image grid working on Py3.4.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 24 Oct 2017 09:12:19 +0000 (11:12 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 24 Oct 2017 09:12:19 +0000 (11:12 +0200)
https://stackoverflow.com/questions/12720450/unpacking-arguments-only-named-arguments-may-follow-expression

pelican-plugins/m/images.py

index f68ac0f0ee8587ee4205f1d6538acd8cd9eac446..a67442188141f486fc09ff41657ba967b2aad762 100644 (file)
@@ -184,7 +184,8 @@ class ImageGrid(rst.Directive):
                 for k, v in im._getexif().items()
                 if k in PIL.ExifTags.TAGS and len(str(v)) < 256
             }
-            caption = "F{}, {}/{} s, ISO {}".format(float(exif['FNumber'][0])/float(exif['FNumber'][1]), *exif['ExposureTime'], exif['ISOSpeedRatings'])
+            # Can't use just *exif['ExposureTime'] on Py3.4
+            caption = "F{}, {}/{} s, ISO {}".format(float(exif['FNumber'][0])/float(exif['FNumber'][1]), exif['ExposureTime'][0], exif['ExposureTime'][1], exif['ISOSpeedRatings'])
             rel_width = float(im.width)/im.height
             total_widths[-1] += rel_width
             rows[-1].append((uri, rel_width, len(total_widths) - 1, caption))