From: Vladimír Vondruš Date: Tue, 24 Oct 2017 09:12:19 +0000 (+0200) Subject: m.images: make image grid working on Py3.4. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=6a6b85d9e356c5af87da8adb554c1853cec74db8;p=blog.git m.images: make image grid working on Py3.4. https://stackoverflow.com/questions/12720450/unpacking-arguments-only-named-arguments-may-follow-expression --- diff --git a/pelican-plugins/m/images.py b/pelican-plugins/m/images.py index f68ac0f0..a6744218 100644 --- a/pelican-plugins/m/images.py +++ b/pelican-plugins/m/images.py @@ -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))