From 94bf13e78e65e1d1bc2e5d6b2311f9c9657bfe5f Mon Sep 17 00:00:00 2001 From: Ben McGinnes Date: Fri, 10 Aug 2018 11:25:01 +1000 Subject: 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 --- lang/python/src/callbacks.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lang/python/src/callbacks.py') 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: -- cgit v1.2.3