コード例 #1
0
 def test_display(self):
     self.assertEqual('[         ]   0%',
                      screen_utils.progress_bar(0, 10, bar_length=10))
     self.assertEqual('[#        ]  10%',
                      screen_utils.progress_bar(1, 10, bar_length=10))
     self.assertEqual('[#####    ]  50%',
                      screen_utils.progress_bar(5, 10, bar_length=10))
     self.assertEqual('[#########] 100%',
                      screen_utils.progress_bar(10, 10, bar_length=10))
     self.assertEqual('[#########] 100%',
                      screen_utils.progress_bar(15, 10, bar_length=10))
コード例 #2
0
ファイル: conduct_load.py プロジェクト: fsat/conductr-cli
 def continue_logging(monitor):
     nonlocal upload_completed
     if not upload_completed:
         uploaded_progress = monitor.bytes_read
         total_size = monitor.len
         upload_completed = monitor.encoder.finished
         progress_bar_text = screen_utils.progress_bar(uploaded_progress, total_size)
         log.progress(progress_bar_text, flush=upload_completed)
コード例 #3
0
 def continue_logging(monitor):
     nonlocal upload_completed
     if not upload_completed:
         uploaded_progress = monitor.bytes_read
         total_size = monitor.len
         upload_completed = monitor.encoder.finished
         progress_bar_text = screen_utils.progress_bar(
             uploaded_progress, total_size)
         log.progress(progress_bar_text, flush=upload_completed)
コード例 #4
0
 def test_display(self):
     self.assertEqual('[         ]   0%', screen_utils.progress_bar(0, 10, bar_length=10))
     self.assertEqual('[#        ]  10%', screen_utils.progress_bar(1, 10, bar_length=10))
     self.assertEqual('[#####    ]  50%', screen_utils.progress_bar(5, 10, bar_length=10))
     self.assertEqual('[#########] 100%', screen_utils.progress_bar(10, 10, bar_length=10))
     self.assertEqual('[#########] 100%', screen_utils.progress_bar(15, 10, bar_length=10))
コード例 #5
0
ファイル: uri_resolver.py プロジェクト: fsat/conductr-cli
 def continue_logging(count, block_size, total_size):
     downloaded_size = count * block_size
     is_download_complete = downloaded_size >= total_size
     progress_bar_text = screen_utils.progress_bar(downloaded_size, total_size)
     log.progress(progress_bar_text, flush=is_download_complete)
コード例 #6
0
 def continue_logging(count, block_size, total_size):
     downloaded_size = count * block_size
     is_download_complete = downloaded_size >= total_size
     progress_bar_text = screen_utils.progress_bar(downloaded_size,
                                                   total_size)
     log.progress(progress_bar_text, flush=is_download_complete)