#NEWLINE# def save( self ) : #NEWLINE# #INDENT# '\n        Save the image to the cache if provided and not cached yet.\n        ' #NEWLINE# if ( self . cache and ( not self . is_cached ) ) : #NEWLINE# #INDENT# image_str = StringIO . StringIO ( ) #NEWLINE# self . pil . save ( image_str , 'png' ) #NEWLINE# self . cache . set ( self . cached_name , image_str . getvalue ( ) ) #NEWLINE# image_str . close ( )