Merge branch 'process-blocks' of github.com:beardog108/onionr into process-blocks

This commit is contained in:
Kevin Froman 2018-01-29 01:05:24 -06:00
commit 40643358fc
3 changed files with 8 additions and 7 deletions

View File

@ -131,7 +131,7 @@ def log(prefix, data, color = ''):
Takes in input from the console, not stored in logs Takes in input from the console, not stored in logs
message: The message to display before taking input message: The message to display before taking input
''' '''
def input(message = 'Enter input: '): def readline(message = 'Enter input: '):
color = colors.fg.green + colors.bold color = colors.fg.green + colors.bold
output = colors.reset + str(color) + '... ' + colors.reset + str(message) + colors.reset output = colors.reset + str(color) + '... ' + colors.reset + str(message) + colors.reset
@ -139,7 +139,8 @@ def input(message = 'Enter input: '):
output = colors.filter(output) output = colors.filter(output)
sys.stdout.write(output) sys.stdout.write(output)
return raw_input()
return input()
''' '''
Displays an "Are you sure" message, returns True for Y and False for N Displays an "Are you sure" message, returns True for Y and False for N
@ -163,7 +164,8 @@ def confirm(default = 'y', message = 'Are you sure %s? '):
output = colors.filter(output) output = colors.filter(output)
sys.stdout.write(output.replace('%s', confirm)) sys.stdout.write(output.replace('%s', confirm))
inp = raw_input().lower()
inp = input().lower()
if 'y' in inp: if 'y' in inp:
return True return True

View File

@ -123,7 +123,7 @@ class Onionr:
logger.info(i) logger.info(i)
elif command in ('addmsg', 'addmessage'): elif command in ('addmsg', 'addmessage'):
while True: while True:
messageToAdd = input('Broadcast message to network: ') messageToAdd = logger.readline('Broadcast message to network: ')
if len(messageToAdd) >= 1: if len(messageToAdd) >= 1:
break break
addedHash = self.onionrCore.setData(messageToAdd) addedHash = self.onionrCore.setData(messageToAdd)

View File

@ -50,7 +50,7 @@ class OnionrUtils:
pass2 = getpass.getpass() pass2 = getpass.getpass()
if pass1 != pass2: if pass1 != pass2:
logger.error("Passwords do not match.") logger.error("Passwords do not match.")
input() logger.readline()
else: else:
break break
else: else:
@ -166,4 +166,3 @@ class OnionrUtils:
if not idNoDomain.isalnum(): if not idNoDomain.isalnum():
retVal = False retVal = False
return retVal return retVal