emaint: cleanup TaskHandler isatty logic
authorZac Medico <zmedico@gentoo.org>
Sat, 11 Aug 2012 21:36:34 +0000 (14:36 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 11 Aug 2012 21:36:34 +0000 (14:36 -0700)
pym/portage/emaint/main.py

index dbc5f18cc2653bcd059a28aae12afa77d3617cb0..5775ce1185200f699e2f8eec449c48492790373f 100644 (file)
@@ -115,7 +115,7 @@ class TaskHandler(object):
                        return
                for task in tasks:
                        inst = task()
-                       show_progress = self.show_progress_bar
+                       show_progress = self.show_progress_bar and self.isatty
                        # check if the function is capable of progressbar 
                        # and possibly override it off
                        if show_progress and hasattr(inst, 'can_progressbar'):
@@ -133,7 +133,7 @@ class TaskHandler(object):
                                'options': options.copy()
                                }
                        result = getattr(inst, func)(**kwargs)
-                       if self.isatty and  show_progress:
+                       if show_progress:
                                # make sure the final progress is displayed
                                self.progress_bar.display()
                                print()