#NEWLINE# def _compare_tile_contents( list_both , output ) : #NEWLINE# #INDENT# 'Compare the tile pairs contained in list_both. Additionally, report\n    those tiles that are only in Database 1, or only in  Database 2.\n\n    Positional arguments: 3 lists as follows:\n    1. production_and_test: those corresponding pairs which exist on Database 1\n       and Database 2.\n    2. production_not_test: the tiles found only on Database 1.\n    3. test_not_production: the tiles found only on Database 2.\n    Each element of the above lists is a 5-tuple:\n    (level_name, tile_class_id on Database 1, tile_class_id on Database 2,\n     tile_pathname on Database 1, tile_pathname on Database 2).\n\n    Returns:\n    List of tile-path pairs (path1, path2) for which a difference has been\n    detected.' #NEWLINE# rec_num = 0 #NEWLINE# difference_pairs = [ ] #NEWLINE# for tile_pair in list_both : #NEWLINE# #INDENT# rec_num += 1 #NEWLINE# is_mosaic_vrt = False #NEWLINE# ( level , tile_class_id1 , tile_class_id2 , path1 , path2 ) = tile_pair #NEWLINE# output . writelines ( ( 'RECORD NUMBER %d tile_class_id2=%d level=%s\n' % ( rec_num , tile_class_id2 , level ) ) ) #NEWLINE# if ( tile_class_id2 in MOSAIC_CLASS_ID ) : #NEWLINE# #INDENT# path1 = os . path . join ( os . path . dirname ( path1 ) , 'mosaic_cache' , os . path . basename ( path1 ) ) #NEWLINE# if ( level in [ 'NBAR' , 'ORTHO' ] ) : #NEWLINE# #INDENT# path1 = ( re . match ( '(.+)\\.tif$' , path1 ) . groups ( 1 ) [ 0 ] + '.vrt' ) #NEWLINE# is_mosaic_vrt = True #NEWLINE# #UNINDENT# #UNINDENT# if is_mosaic_vrt : #NEWLINE# #INDENT# ( data1 , data2 , msg ) = ( None , None , '' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( data1 , data2 , msg ) = _check_tile_metadata ( path1 , path2 ) #NEWLINE# #UNINDENT# if msg : #NEWLINE# #INDENT# output . writelines ( msg ) #NEWLINE# #UNINDENT# ( are_different , msg ) = _compare_data ( level , tile_class_id1 , tile_class_id2 , path1 , path2 , msg , data2 ) #NEWLINE# if are_different : #NEWLINE# #INDENT# difference_pairs . extend ( ( path1 , path2 ) ) #NEWLINE# #UNINDENT# if msg : #NEWLINE# #INDENT# sys . stdout . writelines ( msg ) #NEWLINE# output . writelines ( msg ) #NEWLINE# #UNINDENT# #UNINDENT# return difference_pairs