just call print() once in the odd print_() function

this will help when we want to refactor output functions

this function should definitely be replaced by a __repr__() or
__str__() however
This commit is contained in:
Antoine Beaupré 2015-10-01 12:39:08 -04:00
parent 50fe290770
commit c996fd8366
1 changed files with 8 additions and 7 deletions

View File

@ -143,13 +143,14 @@ class Statistics:
def print_(self, label, cache):
total_size, total_csize, unique_size, unique_csize, total_unique_chunks, total_chunks = cache.chunks.summarize()
print()
print(' Original size Compressed size Deduplicated size')
print('%-15s %20s %20s %20s' % (label, format_file_size(self.osize), format_file_size(self.csize), format_file_size(self.usize)))
print('All archives: %20s %20s %20s' % (format_file_size(total_size), format_file_size(total_csize), format_file_size(unique_csize)))
print()
print(' Unique chunks Total chunks')
print('Chunk index: %20d %20d' % (total_unique_chunks, total_chunks))
buf = "\n"
buf += ' Original size Compressed size Deduplicated size'
buf += '%-15s %20s %20s %20s' % (label, format_file_size(self.osize), format_file_size(self.csize), format_file_size(self.usize))
buf += 'All archives: %20s %20s %20s' % (format_file_size(total_size), format_file_size(total_csize), format_file_size(unique_csize))
buf += "\n"
buf += ' Unique chunks Total chunks'
buf += 'Chunk index: %20d %20d' % (total_unique_chunks, total_chunks)
print(buf)
def show_progress(self, item=None, final=False):
if not final: