Add a "quiet" parameter to the EOutput constructor, and also flush
authorZac Medico <zmedico@gentoo.org>
Mon, 12 Jan 2009 08:26:07 +0000 (08:26 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 12 Jan 2009 08:26:07 +0000 (08:26 -0000)
stderr/stdout stream in the constructor. (trunk r12416)

svn path=/main/branches/2.1.6/; revision=12472

pym/portage/output.py

index f833e8f5daedb38e3a741bd715bd3ffa7f09c840..1f0eec988f5d60e09981ca329b34800d028eceef 100644 (file)
@@ -437,10 +437,10 @@ class EOutput(object):
        @type term_columns: IntType
        """
 
-       def __init__(self):
+       def __init__(self, quiet=False):
                self.__last_e_cmd = ""
                self.__last_e_len = 0
-               self.quiet = False
+               self.quiet = quiet
                lines, columns = get_term_size()
                if columns <= 0:
                        columns = 80
@@ -448,6 +448,8 @@ class EOutput(object):
                if os.environ.get("TERM") in ("cons25", "dumb"):
                        columns = columns - 1
                self.term_columns = columns
+               sys.stdout.flush()
+               sys.stderr.flush()
 
        def __eend(self, caller, errno, msg):
                if errno == 0: