<s> import sublime <EOL> class ThreadProgress ( ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , thread , message , success_message , failure_message = '<STR_LIT>' ) : <EOL> self . thread = thread <EOL> self . message = message <EOL> self . success_message = success_message <EOL> self . failure_message = failure_message <EOL> self . addend = <NUM_LIT:1> <EOL> self . size = <NUM_LIT:8> <EOL> sublime . set_timeout ( lambda : self . run ( <NUM_LIT:0> ) , <NUM_LIT:100> ) <EOL> def run ( self , i ) : <EOL> if not self . thread . is_alive ( ) : <EOL> if hasattr ( self . thread , '<STR_LIT:result>' ) and not self . thread . result : <EOL> sublime . status_message ( self . failure_message ) <EOL> return <EOL> sublime . status_message ( self . success_message ) <EOL> return <EOL> before = i % self . size <EOL> after = ( self . size - <NUM_LIT:1> ) - before <EOL> sublime . status_message ( '<STR_LIT>' % ( self . message , '<STR_LIT:U+0020>' * before , '<STR_LIT:U+0020>' * after ) ) <EOL> if not after : <EOL> self . addend = - <NUM_LIT:1> <EOL> if not before : <EOL> self . addend = <NUM_LIT:1> <EOL> i += self . addend <EOL> sublime . set_timeout ( lambda : self . run ( i ) , <NUM_LIT:100> ) </s>
