Skip to content

Commit

Permalink
Merge pull request #421 from oduwsdl/issue-52
Browse files Browse the repository at this point in the history
Enable encryption prompt to be shown when output is redirected.
  • Loading branch information
machawk1 authored Jul 8, 2018
2 parents d44a613 + 79f7ff8 commit 25aecf8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ipwb/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 25aecf8

Please sign in to comment.