#NEWLINE# def _stdout_display( self , percentage , display = True ) : #NEWLINE# #INDENT# if ( clear_output and ( not ipython2 ) ) : #NEWLINE# #INDENT# clear_output ( ) #NEWLINE# #UNINDENT# if ( clear_output and ipython2 ) : #NEWLINE# #INDENT# clear_output ( wait = True ) #NEWLINE# #UNINDENT# percent_per_char = ( 100.0 / self . width ) #NEWLINE# char_count = int ( ( math . floor ( ( percentage / percent_per_char ) ) if ( percentage < 100.0 ) else self . width ) ) #NEWLINE# blank_count = ( self . width - char_count ) #NEWLINE# prefix = ( '\n' if ( len ( self . current_progress ) > 1 ) else '' ) #NEWLINE# self . out = ( prefix + ( '%s[%s%s] %0.1f%%' % ( ( ( self . label + ':\n' ) if self . label else '' ) , ( self . fill_char * char_count ) , ( ( ' ' * len ( self . fill_char ) ) * blank_count ) , percentage ) ) ) #NEWLINE# if display : #NEWLINE# #INDENT# sys . stdout . write ( '' . join ( [ pg . out for pg in self . current_progress ] ) ) #NEWLINE# sys . stdout . flush ( ) #NEWLINE# time . sleep ( 0.0001 )