diff --git a/onionr/logger.py b/onionr/logger.py index 7577a6db..6a305bfe 100644 --- a/onionr/logger.py +++ b/onionr/logger.py @@ -131,7 +131,7 @@ def log(prefix, data, color = ''): Takes in input from the console, not stored in logs message: The message to display before taking input ''' -def input(message = 'Enter input: '): +def readline(message = 'Enter input: '): color = colors.fg.green + colors.bold output = colors.reset + str(color) + '... ' + colors.reset + str(message) + colors.reset @@ -139,7 +139,8 @@ def input(message = 'Enter input: '): output = colors.filter(output) sys.stdout.write(output) - return raw_input() + + return input() ''' 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) sys.stdout.write(output.replace('%s', confirm)) - inp = raw_input().lower() + + inp = input().lower() if 'y' in inp: return True diff --git a/onionr/onionr.py b/onionr/onionr.py index a3d2bd4e..ef63ead1 100755 --- a/onionr/onionr.py +++ b/onionr/onionr.py @@ -115,7 +115,7 @@ class Onionr: logger.info(i) elif command in ('addmsg', 'addmessage'): while True: - messageToAdd = input('Broadcast message to network: ') + messageToAdd = logger.readline('Broadcast message to network: ') if len(messageToAdd) >= 1: break addedHash = self.onionrCore.setData(messageToAdd) @@ -165,4 +165,4 @@ class Onionr: def showHelp(self): '''Show help for Onionr''' return -Onionr() \ No newline at end of file +Onionr() diff --git a/onionr/onionrutils.py b/onionr/onionrutils.py index ec7517e2..1884bb5a 100644 --- a/onionr/onionrutils.py +++ b/onionr/onionrutils.py @@ -50,7 +50,7 @@ class OnionrUtils: pass2 = getpass.getpass() if pass1 != pass2: logger.error("Passwords do not match.") - input() + logger.readline() else: break else: @@ -166,4 +166,3 @@ class OnionrUtils: if not idNoDomain.isalnum(): retVal = False return retVal -