Improve REPL output formatting

- Omit output when the value is `undefined`.
- Display error output in bright red.
This commit is contained in:
Ole André Vadla Ravnås
2015-02-28 22:19:59 +01:00
parent e478924399
commit e180faadfb
+4 -5
View File
@@ -1,5 +1,6 @@
def main():
from frida.application import ConsoleApplication
from colorama import Fore, Style
import json
try:
import readline
@@ -132,11 +133,9 @@ def main():
if stanza['name'] == '+result':
output = json.dumps(value, sort_keys=True, indent=4, separators=(",", ": "))
else:
output = value
else:
output = "undefined"
sys.stdout.write(output + "\n")
sys.stdout.flush()
output = Fore.RED + Style.BRIGHT + value
sys.stdout.write(output + "\n")
sys.stdout.flush()
self._idle.set()
handled = True