aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/src/callbacks.py
diff options
context:
space:
mode:
authorBen McGinnes <[email protected]>2018-08-10 01:25:01 +0000
committerBen McGinnes <[email protected]>2018-08-10 01:25:01 +0000
commit94bf13e78e65e1d1bc2e5d6b2311f9c9657bfe5f (patch)
treeea23101d276096ece7c4eb656fe1c70611953c6d /lang/python/src/callbacks.py
parentLink fixes (diff)
downloadgpgme-94bf13e78e65e1d1bc2e5d6b2311f9c9657bfe5f.tar.gz
gpgme-94bf13e78e65e1d1bc2e5d6b2311f9c9657bfe5f.zip
PEP8 compliance and other code fixes
* Ran all the .py files in src/ and below through Yapf. * Included some manual edits of core.py, this time successfully making two notorious sections a bit more pythonic than scheming. * Left the module imports as is. * This will be committed if it passes the most essential test: compiling, installing and running it. Signed-off-by: Ben McGinnes <[email protected]>
Diffstat (limited to 'lang/python/src/callbacks.py')
-rw-r--r--lang/python/src/callbacks.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lang/python/src/callbacks.py b/lang/python/src/callbacks.py
index b25a9a74..e8a9c432 100644
--- a/lang/python/src/callbacks.py
+++ b/lang/python/src/callbacks.py
@@ -20,6 +20,7 @@ del absolute_import, print_function, unicode_literals
from getpass import getpass
+
def passphrase_stdin(hint, desc, prev_bad, hook=None):
"""This is a sample callback that will read a passphrase from
the terminal. The hook here, if present, will be used to describe
@@ -32,10 +33,12 @@ def passphrase_stdin(hint, desc, prev_bad, hook=None):
print("Please supply %s' password%s:" % (hint, why))
return getpass()
+
def progress_stdout(what, type, current, total, hook=None):
print("PROGRESS UPDATE: what = %s, type = %d, current = %d, total = %d" %\
(what, type, current, total))
+
def readcb_fh(count, hook):
"""A callback for data. hook should be a Python file-like object."""
if count: