From 5efe130f75c5246b1e63d0d831b90dadd721f61f Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 14 Mar 2015 18:44:48 -0500 Subject: [PATCH] Fix an error with GitPython 0.3.6. --- gitup/update.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gitup/update.py b/gitup/update.py index dd8a06e..9feb875 100644 --- a/gitup/update.py +++ b/gitup/update.py @@ -34,15 +34,23 @@ class _ProgressMonitor(RemoteProgress): def update(self, op_code, cur_count, max_count=None, message=''): """Called whenever progress changes. Overrides default behavior.""" if op_code & (self.COMPRESSING | self.RECEIVING): + cur_count = str(int(cur_count)) + if max_count: + max_count = str(int(max_count)) if op_code & self.BEGIN: print("\b, " if self._started else " (", end="") if not self._started: self._started = True if op_code & self.END: end = ")" - else: + elif max_count: end = "\b" * (1 + len(cur_count) + len(max_count)) - print("{0}/{1}".format(cur_count, max_count), end=end) + else: + end = "\b" * len(cur_count) + if max_count: + print("{0}/{1}".format(cur_count, max_count), end=end) + else: + print(str(cur_count), end=end) class _Stasher(object):