def _explode_image_url(image_url): frames = cache.get(image_url) if frames is None: print "Nothing found in cache for %s" % image_url try: exploder = GifExplode(image_url) frames = exploder.explode() print "Setting cache for %s" % image_url cache.set(image_url, frames, timeout=60*60) except ValueError, e: print e abort(500)
def _explode_image_url(image_url): image_data = cache.get(image_url) if image_data is None: print "Nothing found in cache for %s" % image_url try: exploder = GifExplode(image_url) image_data = exploder.explode() print "Setting cache for %s" % image_url cache.set(image_url, image_data, timeout=5*60) except ValueError: abort(500) else: print "Using cache for %s" % image_url return image_data