#NEWLINE# def _setup_progressbar( self ) : #NEWLINE# #INDENT# '\n        Instantiates and configures the ProgressBar for the importer.\n        ' #NEWLINE# count_query_string = ( 'SELECT count(*) AS count from %s' % self . table_name ) #NEWLINE# self . row_count = self . cursor . execute ( count_query_string ) . fetchone ( ) [ 'count' ] #NEWLINE# assert ( self . row_count > 0 ) , ( 'Row count for table %s is 0.' % widgets . table_name ) #NEWLINE# self . progress_update_interval = max ( 1 , ( self . row_count / 100 ) ) #NEWLINE# self . progress_update_interval = min ( 500 , self . progress_update_interval ) #NEWLINE# bar_label = ( ' - %s: ' % self . table_name ) #NEWLINE# widgets = [ bar_label , Percentage ( ) , ' ' , Bar ( marker = '=' , left = '[' , right = ']' ) , ' ' , ETA ( ) ] #NEWLINE# self . pbar = ProgressBar ( widgets = widgets , maxval = self . row_count ) #NEWLINE# self . pbar . start ( )