#NEWLINE# @ cmdln . option ( '' , '--no-break' , action = 'store_true' , help = "Don't break from loop" ) #NEWLINE# def do_think( self , subcmd , opts , length = 200 ) : #NEWLINE# #INDENT# '${cmd_name}: Progress bar example\n        \n        ${cmd_usage}\n        ${cmd_option_list}\n        ' #NEWLINE# with self . bootstrapped ( ) : #NEWLINE# #INDENT# import time #NEWLINE# length = int ( length ) #NEWLINE# for x in textui . ProgressBar . iterate ( range ( length ) , post = 'Thought {total} thoughts in time {elapsed}' ) : #NEWLINE# #INDENT# if ( ( x == ( length - 1 ) ) and ( not length . no_break ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# time . sleep ( 0.1 )