Commits

Peter Ward committed 83f2069

Hander for a single image.

Comments (0)

Files changed (2)

shinypress/handlers/__init__.py

     lyrics=lyrics.render,
     pdf=pdf.render,
     images=images.render,
+    image=images.render_single,
 
     background=hacks.background,
 )

shinypress/handlers/images.py

     images = sorted(glob(os.path.join(directory, "*.jpg")))
     return (template.render(images=images), [])
 
+def render_single(image):
+    return (template.render(images=[image]), [open(image, 'rb')])
+