[meld/VersionControlRework: 110/123] misc: Make read_pipe_iter require a working directory as well



commit 449d231c08af78bd59afc7cad3818ce1fb45362d
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Apr 18 08:53:10 2015 +1000

    misc: Make read_pipe_iter require a working directory as well

 meld/misc.py   |    5 +----
 meld/vcview.py |    5 +++--
 2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/meld/misc.py b/meld/misc.py
index c784934..a7160e4 100644
--- a/meld/misc.py
+++ b/meld/misc.py
@@ -178,13 +178,12 @@ def shorten_names(*names):
     return [name or _("[None]") for name in basenames]
 
 
-def read_pipe_iter(command, errorstream, yield_interval=0.1, workdir=None):
+def read_pipe_iter(command, workdir, errorstream, yield_interval=0.1):
     """Read the output of a shell command iteratively.
 
     Each time 'callback_interval' seconds pass without reading any data,
     this function yields None.
     When all the data is read, the entire string is yielded.
-    If 'workdir' is specified the command is run from that directory.
     """
     class sentinel(object):
         def __init__(self):
@@ -234,8 +233,6 @@ def read_pipe_iter(command, errorstream, yield_interval=0.1, workdir=None):
                 errorstream.error("Exit code: %i\n" % status)
             yield "".join(bits)
             yield status
-    if workdir == "":
-        workdir = None
     return sentinel()()
 
 
diff --git a/meld/vcview.py b/meld/vcview.py
index 3a4b0b7..a9b2754 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -577,8 +577,9 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
         r = None
         msg = shelljoin(command + files) + " (in %s)\n" % working_dir
         self.consolestream.command(msg)
-        readiter = misc.read_pipe_iter(command + files, self.consolestream,
-                                       workdir=working_dir)
+        readiter = misc.read_pipe_iter(
+            command + files, workdir=working_dir,
+            errorstream=self.consolestream)
         try:
             while r is None:
                 r = next(readiter)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]