• FWeinb

    Just got my iPad yesterday and could not wait to try this app.
    I created a basic gallery using bottle getting to know some Python.

    I really just want to say thanks for creating such an awesome app!


    from bottle import route, run, template, response
    import photos
    import json
    import StringIO
    def imageHeader(resp):
      resp.set_header('Content-Disposition','attachment; filename=img.jpg')
    def image(id):
      return photos.get_image(id, True ,True)
    def thumb(id):
      buff = StringIO.StringIO()
      photos.get_thumbnail(id).save(buff, format='jpeg')
      val = buff.getvalue()
      return val
    def meta(id):
        return json.dumps(photos.get_metadata(id))
    # by ccc
    def index():
      fmt = '<a href="/image/{}"><img src="/thumb/{}" width="75" height="75"/></a>\n'
      return [fmt.format(x, x) for x in xrange(photos.get_count())]
    run(host='localhost', port=8080)

    posted in Pythonista read more
  • FWeinb

    Thanks @ccc I included it in the original posting.

    Would be great if we could build a complete gallery. Including meta data and other stuff.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!