From e4a1b6ea15ed71dcf52e3b42c27b8347753f06b5 Mon Sep 17 00:00:00 2001 From: Adam Waldenberg Date: Fri, 19 Oct 2012 02:00:34 +0200 Subject: [PATCH] The blame module now only shows progress in text format output. --- blame.py | 3 ++- format.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/blame.py b/blame.py index 7f2cbba..046b54f 100644 --- a/blame.py +++ b/blame.py @@ -21,6 +21,7 @@ from __future__ import print_function from changes import FileDiff import comment import filtering +import format import missing import multiprocessing import re @@ -103,7 +104,7 @@ class Blame: @staticmethod def output_progress(pos, length): - if sys.stdout.isatty(): + if sys.stdout.isatty() and format.is_interactive_format(): terminal.clear_row() print("\bChecking how many rows belong to each author (Progress): {0:.0f}%".format(100 * pos / length), end="") sys.stdout.flush() diff --git a/format.py b/format.py index f388783..452959d 100644 --- a/format.py +++ b/format.py @@ -34,6 +34,10 @@ def select(format): return format in __available_formats__ +def is_interactive_format(): + global __selected_format__ + return __selected_format__ == "text" + def output_header(): if __selected_format__ == "html": pass