From 39712a852576c3d844b98f69dfb46ec3d4ef093b Mon Sep 17 00:00:00 2001 From: Roman Khassraf Date: Tue, 31 Jan 2017 21:30:02 +0100 Subject: [PATCH] #2: Adds conditional printing in method getLogins --- keepasshttp/protocol.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keepasshttp/protocol.py b/keepasshttp/protocol.py index 80e848e..516453e 100644 --- a/keepasshttp/protocol.py +++ b/keepasshttp/protocol.py @@ -41,7 +41,7 @@ def testAssociate(id_, key, requestor=None): return requestor(key, input_data, id_) -def getLogins(url, id_, key, requestor=None): +def getLogins(url, id_, key, requestor=None, print_output=False): """Query keepass for entries that match `url`""" requestor = requestor or DEFAULT_REQUESTOR iv = crypto.getRandomIV() @@ -50,7 +50,8 @@ def getLogins(url, id_, key, requestor=None): 'Url': crypto.encrypt(url, key, iv) } output = requestor(key, input_data, id_, iv=iv) - print output + if print_output: + print output decrypted = [ crypto.decryptDict(entry, key, output['Nonce']) for entry in output.get('Entries', [])