#NEWLINE# def fill_attr_apply( self , mapping ) : #NEWLINE# #INDENT# '\n        Apply an attribute-mapping dictionary to the canvas.\n\n        mapping -- dictionary of original-attribute:new-attribute items\n        ' #NEWLINE# if self . widget_info : #NEWLINE# #INDENT# raise self . _finalized_error #NEWLINE# #UNINDENT# shards = [ ] #NEWLINE# for ( num_rows , original_cviews ) in self . shards : #NEWLINE# #INDENT# new_cviews = [ ] #NEWLINE# for cv in original_cviews : #NEWLINE# #INDENT# if ( cv [ 4 ] is None ) : #NEWLINE# #INDENT# new_cviews . append ( ( ( cv [ : 4 ] + ( mapping , ) ) + cv [ 5 : ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# combined = dict ( mapping ) #NEWLINE# combined . update ( [ ( k , mapping . get ( v , v ) ) for ( k , v ) in cv [ 4 ] . items ( ) ] ) #NEWLINE# new_cviews . append ( ( ( cv [ : 4 ] + ( combined , ) ) + cv [ 5 : ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# shards . append ( ( num_rows , new_cviews ) ) #NEWLINE# #UNINDENT# self . shards = mapping