[meld] _vc.py: Add a call() function
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] _vc.py: Add a call() function
- Date: Sat, 21 Aug 2010 22:42:13 +0000 (UTC)
commit 90a1174db5844be5374f0f82df2943566e8c3048
Author: Peter Tyser <ptyser gmail com>
Date: Tue Aug 17 23:47:57 2010 -0500
_vc.py: Add a call() function
This is similar to the popen() function that is already implemented in
_vc.py, but it returns a called function's return code whereas popen()
returns the stdout output.
Signed-off-by: Peter Tyser <ptyser gmail com>
meld/vc/_vc.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/meld/vc/_vc.py b/meld/vc/_vc.py
index 413e072..27844d6 100644
--- a/meld/vc/_vc.py
+++ b/meld/vc/_vc.py
@@ -200,6 +200,10 @@ class CachedVc(Vc):
self.cache_inventory(directory)
return self._tree_cache
+# Return the stdout output of a given command
def popen(cmd, cwd=None):
return subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE).stdout
+# Return the return value of a given command
+def call(cmd, cwd=None):
+ return subprocess.call(cmd, cwd=cwd, stdout=subprocess.PIPE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]