Skip to content

Commit

Permalink
Fixed subprocess example code in README.
Browse files Browse the repository at this point in the history
Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>
  • Loading branch information
mkouhei committed May 28, 2014
1 parent 29c48d6 commit 78d9157
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ It was the same in the case of using gnupg-agent and keyring.::

>>> import subprocess
>>> import shlex
>>> command = '/usr/bin/debsign -k %s %s' % (`keyid`, `.changes`)'
>>> process = subprocess.Popen(shlex.split(command),
... stdin=subprocess.PIPE,
... stdout=subprocess.PIPE,
... stderr=subprocess.PIPE)
>>> stdout, stderr = process.communicate('%s\n%s\n') % (`passphrase`, `passphrase`)
>>> command0 = 'echo -e "%s\n%s\n"' % (`passphrase`, `passphrase`)
>>> command1 = '/usr/bin/debsign -k %s %s' % (`keyid`, `.changes`)
>>> process0 = subprocess.Popen(shlex.split(command0),
... stdin=subprocess.PIPE,
... stdout=subprocess.PIPE,
... stderr=subprocess.PIPE)
>>> process1 = subprocess.Popen(shlex.split(command1),
... stdin=process0.stdout,
... stdout=subprocess.PIPE,
... stderr=subprocess.PIPE)
>>> stdout, stderr = process.communicate()

So, I decided to make a Python library to do the same behavior debsign.

Expand Down

0 comments on commit 78d9157

Please sign in to comment.