summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/__main__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/__main__.py b/test/__main__.py
index c3437ea..bb971f2 100644
--- a/test/__main__.py
+++ b/test/__main__.py
@@ -30,6 +30,8 @@ Run a Firefox-type browser with WebDriver attached and Python console open
import sys
import time
import code
+from rlcompleter import Completer
+import readline
from .server import do_an_internet
from .misc_constants import *
@@ -53,6 +55,11 @@ driver = firefox_safe_mode(proxy_port=int(port))
print("You can now control the browser through 'driver' object")
+# Here we enable readline-enhanced editing:
+# https://stackoverflow.com/questions/35115208/is-there-any-way-to-combine-readline-rlcompleter-and-interactiveconsole-in-pytho#answer-35116399
+readline.parse_and_bind('tab: complete');
+console_locals = globals()
+readline.set_completer(Completer(console_locals).complete)
code.InteractiveConsole(locals=globals()).interact()
driver.quit()