aboutsummaryrefslogtreecommitdiff
path: root/progress.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-04-18 09:59:18 -0700
committerShawn O. Pearce <sop@google.com>2009-04-18 09:59:18 -0700
commit6ed4e2834639d0b08686882d2e39cd736d66c688 (patch)
tree216ff96fd66a7dd0527305e2e96803e704a0d37a /progress.py
parentad3193a0e587073dee0edef46bdf24f6c6e09779 (diff)
downloadrepo-6ed4e2834639d0b08686882d2e39cd736d66c688.tar.gz
Disable the progress meter when trace is enabled
The trace output often interfers with the progress meter, so its easier to just disable the progress meter if trace is active. Its already verbose enough to let the user know we are working, which is all the progress meter is there for anyway. Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'progress.py')
-rw-r--r--progress.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/progress.py b/progress.py
index 580ae88..98bb642 100644
--- a/progress.py
+++ b/progress.py
@@ -14,6 +14,7 @@
# limitations under the License.
import sys
+from trace import IsTrace
class Progress(object):
def __init__(self, title, total=0):
@@ -25,6 +26,9 @@ class Progress(object):
def update(self, inc=1):
self._done += inc
+ if IsTrace():
+ return
+
if self._total <= 0:
sys.stderr.write('\r%s: %d, ' % (
self._title,
@@ -43,6 +47,9 @@ class Progress(object):
sys.stderr.flush()
def end(self):
+ if IsTrace():
+ return
+
if self._total <= 0:
sys.stderr.write('\r%s: %d, done. \n' % (
self._title,