1515
1616
1717def example (fn ):
18- ''' Wrap the examples so they generate readable output'''
18+ """ Wrap the examples so they generate readable output"""
1919
2020 @functools .wraps (fn )
2121 def wrapped (* args , ** kwargs ):
@@ -34,7 +34,7 @@ def wrapped(*args, **kwargs):
3434
3535@example
3636def fast_example ():
37- ''' Updates bar really quickly to cause flickering'''
37+ """ Updates bar really quickly to cause flickering"""
3838 with progressbar .ProgressBar (widgets = [progressbar .Bar ()]) as bar :
3939 for i in range (100 ):
4040 bar .update (int (i / 10 ), force = True )
@@ -55,8 +55,10 @@ def prefixed_shortcut_example():
5555@example
5656def parallel_bars_multibar_example ():
5757 if os .name == 'nt' :
58- print ('Skipping multibar example on Windows due to threading '
59- 'incompatibilities with the example code.' )
58+ print (
59+ 'Skipping multibar example on Windows due to threading '
60+ 'incompatibilities with the example code.'
61+ )
6062 return
6163
6264 BARS = 5
@@ -125,8 +127,8 @@ def templated_shortcut_example():
125127@example
126128def job_status_example ():
127129 with progressbar .ProgressBar (
128- redirect_stdout = True ,
129- widgets = [progressbar .widgets .JobStatusBar ('status' )],
130+ redirect_stdout = True ,
131+ widgets = [progressbar .widgets .JobStatusBar ('status' )],
130132 ) as bar :
131133 for _ in range (30 ):
132134 print ('random' , random .random ())
@@ -311,9 +313,9 @@ def file_transfer_example():
311313@example
312314def custom_file_transfer_example ():
313315 class CrazyFileTransferSpeed (progressbar .FileTransferSpeed ):
314- '''
316+ """
315317 It's bigger between 45 and 80 percent
316- '''
318+ """
317319
318320 def update (self , bar ):
319321 if 45 < bar .percentage () < 80 :
@@ -533,7 +535,7 @@ def format_label_rotating_bouncer():
533535@example
534536def with_right_justify ():
535537 with progressbar .ProgressBar (
536- max_value = 10 , term_width = 20 , left_justify = False
538+ max_value = 10 , term_width = 20 , left_justify = False
537539 ) as progress :
538540 assert progress .term_width is not None
539541 for i in range (10 ):
@@ -543,7 +545,8 @@ def with_right_justify():
543545@example
544546def exceeding_maximum ():
545547 with progressbar .ProgressBar (max_value = 1 ) as progress , contextlib .suppress (
546- ValueError ):
548+ ValueError
549+ ):
547550 progress .update (2 )
548551
549552
@@ -572,7 +575,7 @@ def stderr_redirection():
572575def rotating_bouncing_marker ():
573576 widgets = [progressbar .BouncingBar (marker = progressbar .RotatingMarker ())]
574577 with progressbar .ProgressBar (
575- widgets = widgets , max_value = 20 , term_width = 10
578+ widgets = widgets , max_value = 20 , term_width = 10
576579 ) as progress :
577580 for i in range (20 ):
578581 time .sleep (0.1 )
@@ -584,7 +587,7 @@ def rotating_bouncing_marker():
584587 )
585588 ]
586589 with progressbar .ProgressBar (
587- widgets = widgets , max_value = 20 , term_width = 10
590+ widgets = widgets , max_value = 20 , term_width = 10
588591 ) as progress :
589592 for i in range (20 ):
590593 time .sleep (0.1 )
@@ -757,9 +760,9 @@ def user_variables():
757760 num_subtasks = sum (len (x ) for x in tasks .values ())
758761
759762 with progressbar .ProgressBar (
760- prefix = '{variables.task} >> {variables.subtask}' ,
761- variables = {'task' : '--' , 'subtask' : '--' },
762- max_value = 10 * num_subtasks ,
763+ prefix = '{variables.task} >> {variables.subtask}' ,
764+ variables = {'task' : '--' , 'subtask' : '--' },
765+ max_value = 10 * num_subtasks ,
763766 ) as bar :
764767 for tasks_name , subtasks in tasks .items ():
765768 for subtask_name in subtasks :
0 commit comments