aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-08-17 15:32:16 +0000
committerNicolas Vigier <boklm@mageia.org>2011-08-17 15:32:16 +0000
commit05733acd4c7a9de98156378045d4e4050cfb65db (patch)
tree136b50f23155cc076e93f6ed73224f73c5f4a6f7 /MgaRepo
parent739efd30ba53923ad51f75420a452789909cc324 (diff)
downloadmgarepo-05733acd4c7a9de98156378045d4e4050cfb65db.tar
mgarepo-05733acd4c7a9de98156378045d4e4050cfb65db.tar.gz
mgarepo-05733acd4c7a9de98156378045d4e4050cfb65db.tar.bz2
mgarepo-05733acd4c7a9de98156378045d4e4050cfb65db.tar.xz
mgarepo-05733acd4c7a9de98156378045d4e4050cfb65db.zip
allow changing stdin when executing command
Diffstat (limited to 'MgaRepo')
-rw-r--r--MgaRepo/util.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/MgaRepo/util.py b/MgaRepo/util.py
index c73c098..e8aef0a 100644
--- a/MgaRepo/util.py
+++ b/MgaRepo/util.py
@@ -27,8 +27,10 @@ def execcmd(*cmd, **kwargs):
if kwargs.get("show"):
if kwargs.get("geterr"):
err = StringIO()
+ pstdin = kwargs.get("stdin") if kwargs.get("stdin") else None
pipe = subprocess.Popen(cmdstr, shell=True,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ stdin=pstdin)
of = pipe.stdout.fileno()
ef = pipe.stderr.fileno()
while True: