1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 09:47:58 +00:00

satisfy codecov

This commit is contained in:
Abogical 2016-11-14 17:37:49 +02:00
parent 3896f26ab2
commit 34f529c7df
2 changed files with 9 additions and 0 deletions

View file

@ -547,6 +547,7 @@ def peek_and_store_hardlink_masters(item, matched):
if pattern.match_count == 0:
self.print_warning("Include pattern '%s' never matched.", pattern)
if pi:
# clear progress output
pi.finish()
return self.exit_code

View file

@ -1201,6 +1201,7 @@ def ellipsis_truncate(msg, space):
ellipsis_width = swidth('...')
msg_width = swidth(msg)
if space < 8:
# if there is very little space, just show ...
return '...' + ' ' * (space - ellipsis_width)
if space < ellipsis_width + msg_width:
return '%s...%s' % (swidth_slice(msg, space // 2 - ellipsis_width),
@ -1256,6 +1257,13 @@ def progress(self, current=None, increase=1):
return pct
def show(self, current=None, increase=1, info=None):
"""
Show and output the progress message
:param current: set the current percentage [None]
:param increase: increase the current percentage [None]
:param info: array of strings to be formatted with msg [None]
"""
pct = self.progress(current, increase)
if pct is not None:
# truncate the last argument, if no space is available