#NEWLINE# def redisplay( self , root ) : #NEWLINE# #INDENT# if ( self . result . code == preview_thread . COMPLETE ) : #NEWLINE# #INDENT# root . cols = self . result . columnCount #NEWLINE# while ( len ( root . children ) > len ( self . result . data ) ) : #NEWLINE# #INDENT# root . remove_widget ( root . children [ ( - 1 ) ] ) #NEWLINE# #UNINDENT# while ( len ( self . children ) < len ( self . result . data ) ) : #NEWLINE# #INDENT# root . add_widget ( Image ( ) ) #NEWLINE# #UNINDENT# for i in xrange ( 0 , len ( self . result . data ) ) : #NEWLINE# #INDENT# current = root . children [ i ] #NEWLINE# if ( len ( self . textures ) <= i ) : #NEWLINE# #INDENT# self . textures . append ( Texture . create_from_data ( self . result . data [ i ] ) ) #NEWLINE# self . textures [ i ] . flip_vertical ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . textures [ i ] . blit_data ( self . result . data [ i ] ) #NEWLINE# #UNINDENT# current . texture = None #NEWLINE# current . texture = self . textures [ i ] #NEWLINE# current . size_hint = ( ( ( 1.0 * self . result . sizes [ i ] [ 0 ] ) / self . result . width ) , ( ( 1.0 * self . result . sizes [ i ] [ 1 ] ) / self . result . height ) ) #NEWLINE# #UNINDENT# root . width = ( ( root . height * self . result . width ) / self . result . height ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# root . clear_widgets ( )