[PATCH] write_pipe(): Discard stdout output
- From: Peter Tyser <ptyser gmail com>
- To: meld-list gnome org
- Subject: [PATCH] write_pipe(): Discard stdout output
- Date: Sun, 11 Apr 2010 15:30:34 -0500
Previously, meld would print any stdout output from a command executed
via the write_pipe() function to the command line. As an example:
$ ./bin/meld ./
(Double click on the git.py file in the meld GUI)
patching file meld/vc/git.py
(Double click on the _vc.py file in the meld GUI)
patching file meld/vc/_vc.py
The "patching file XYZ" output from the 'patch' command litters the
terminal window used to execute meld and doesn't provide any useful
information.
This change discards the stdout output of a command executed via the
write_pipe() function. Note that stderr output will still be
printed to the command line as it can be useful in diagnosing why
a sub-command is having errors.
Signed-off-by: Peter Tyser <ptyser gmail com>
---
meld/misc.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/meld/misc.py b/meld/misc.py
index a434f1c..2139452 100644
--- a/meld/misc.py
+++ b/meld/misc.py
@@ -237,9 +237,9 @@ def read_pipe_iter(command, errorstream, yield_interval=0.1, workdir=None):
return sentinel()()
def write_pipe(command, text):
- """Write 'text' into a shell command.
+ """Write 'text' into a shell command and discard its stdout output.
"""
- proc = subprocess.Popen(command, stdin=subprocess.PIPE)
+ proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
proc.communicate(text)
return proc.wait()
--
1.6.2-rc2.GIT
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]