<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from corehq . blobs . exceptions import NotFound <EOL> class MigratingBlobDB ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , new_db , old_db ) : <EOL> self . new_db = new_db <EOL> self . old_db = old_db <EOL> def put ( self , * args , ** kw ) : <EOL> return self . new_db . put ( * args , ** kw ) <EOL> def get ( self , * args , ** kw ) : <EOL> try : <EOL> return self . new_db . get ( * args , ** kw ) <EOL> except NotFound : <EOL> return self . old_db . get ( * args , ** kw ) <EOL> def delete ( self , * args , ** kw ) : <EOL> new_result = self . new_db . delete ( * args , ** kw ) <EOL> old_result = self . old_db . delete ( * args , ** kw ) <EOL> return new_result or old_result <EOL> def get_path ( self , * args , ** kw ) : <EOL> return self . new_db . get_path ( * args , ** kw ) <EOL> def copy_blob ( self , content , info , bucket ) : <EOL> self . new_db . copy_blob ( content , info , bucket ) </s>
