Przeglądaj źródła

satisfy codecov

Abogical 8 lat temu
rodzic
commit
34f529c7df
2 zmienionych plików z 9 dodań i 0 usunięć
  1. 1 0
      src/borg/archiver.py
  2. 8 0
      src/borg/helpers.py

+ 1 - 0
src/borg/archiver.py

@@ -547,6 +547,7 @@ class Archiver:
             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
 

+ 8 - 0
src/borg/helpers.py

@@ -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 @@ class ProgressIndicatorPercent:
             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