aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/pyme/__init__.py
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-05-17 12:15:21 +0000
committerJustus Winter <[email protected]>2016-05-17 12:22:22 +0000
commit10328324c8fc9725cd0c885eaebfc80dc32c1ff6 (patch)
tree425531ecd2daf5eb85caf1229b62a0834ec6132b /lang/python/pyme/__init__.py
parentpython: Import GPGMEError. (diff)
downloadgpgme-10328324c8fc9725cd0c885eaebfc80dc32c1ff6.tar.gz
gpgme-10328324c8fc9725cd0c885eaebfc80dc32c1ff6.zip
python: Clean up examples.
* lang/python/examples/delkey.py: Clean up example. * lang/python/examples/encrypt-to-all.py: Likewise. * lang/python/examples/genkey.py: Likewise. * lang/python/examples/inter-edit.py: Likewise. * lang/python/examples/sign.py: Likewise. * lang/python/examples/signverify.py: Likewise. * lang/python/examples/simple.py: Likewise. * lang/python/examples/t-edit.py: Likewise. * lang/python/examples/verifydetails.py: Likewise. * lang/python/pyme/__init__.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/pyme/__init__.py')
-rw-r--r--lang/python/pyme/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lang/python/pyme/__init__.py b/lang/python/pyme/__init__.py
index 4934afe7..7716e51c 100644
--- a/lang/python/pyme/__init__.py
+++ b/lang/python/pyme/__init__.py
@@ -84,6 +84,7 @@ QUICK START SAMPLE PROGRAM
This program is not for serious encryption, but for example purposes only!
import sys
+import os
from pyme import core, constants
# Set up our input and output buffers.
@@ -99,6 +100,7 @@ c.set_armor(1)
# Set up the recipients.
sys.stdout.write("Enter name of your recipient: ")
+sys.stdout.flush()
name = sys.stdin.readline().strip()
c.op_keylist_start(name, 0)
r = c.op_keylist_next()
@@ -106,8 +108,8 @@ r = c.op_keylist_next()
# Do the encryption.
c.op_encrypt([r], 1, plain, cipher)
-cipher.seek(0,0)
-print cipher.read()
+cipher.seek(0, os.SEEK_SET)
+sys.stdout.buffer.write(cipher.read())
Note that although there is no explicit error checking done here, the
Python GPGME library is automatically doing error-checking, and will