Exemplo n.º 1
0
 def src(photo_key, size=None):
   SIZES = (32, 48, 64, 72, 94, 104, 110, 128, 144, 150, 160, 200, 220, 288, 320, 400, 512, 576, 640, 720, 800, 912, 1024, 1152, 1280, 1440, 1600)
   img_url = PicasaStorage().url(photo_key)
   if size is not None:
     try:
       size = SIZES[bisect(SIZES, size-1)]
     except IndexError:
       size = SIZES[-1]
     url, img = img_url.rsplit ('/',1)
     return '%s/s%d/%s' %(url, size, img)
   return  img_url
Exemplo n.º 2
0
 def src(photo_key, size=None):
     SIZES = (32, 48, 64, 72, 94, 104, 110, 128, 144, 150, 160, 200, 220,
              288, 320, 400, 512, 576, 640, 720, 800, 912, 1024, 1152, 1280,
              1440, 1600)
     img_url = PicasaStorage().url(photo_key)
     if size is not None:
         try:
             size = SIZES[bisect(SIZES, size - 1)]
         except IndexError:
             size = SIZES[-1]
         url, img = img_url.rsplit('/', 1)
         return '%s/s%d/%s' % (url, size, img)
     return img_url
Exemplo n.º 3
0
def albums():
    from picasa import PicasaStorage

    storage = PicasaStorage()
    return [(a.title.text, a.title.text) for a in storage.albumsFromUser()]
Exemplo n.º 4
0
def albums():
    from picasa import PicasaStorage
    storage = PicasaStorage()
    return [(a.title.text, a.title.text) for a in storage.albumsFromUser()]