From 79f7ff8cecf1d10f9e636978595453a434abdf04 Mon Sep 17 00:00:00 2001 From: Mat Kelly Date: Sat, 7 Jul 2018 23:35:17 -0400 Subject: [PATCH] Enable encryption prompt to be shown when output is redirected. Closes #52 --- ipwb/indexer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ipwb/indexer.py b/ipwb/indexer.py index b4f96f0c..0c2a8589 100755 --- a/ipwb/indexer.py +++ b/ipwb/indexer.py @@ -289,8 +289,8 @@ def askUserForEncryptionKey(): outputRedirected = os.fstat(0) != os.fstat(1) promptString = 'Enter a key for encryption: ' if outputRedirected: # Prevents prompt in redir output + logError(promptString, end='') promptString = '' - print(promptString, file=sys.stderr) key = input(promptString) @@ -324,8 +324,8 @@ def showProgress(msg, i, n): print(finalMsg + spaces, file=sys.stderr, end='\r\n') -def logError(errIn): - print(errIn, file=sys.stderr) +def logError(errIn, end='\n'): + print(errIn, file=sys.stderr, end=end) def pullFromIPFS(hash):