Project

General

Profile

« Previous | Next » 

Revision 4c933941

Added by koszko over 1 year ago

enable in-line command editing in the Python prompt shown as part of make test-environment

View differences:

test/__main__.py
30 30
import sys
31 31
import time
32 32
import code
33
from rlcompleter import Completer
34
import readline
33 35

  
34 36
from .server import do_an_internet
35 37
from .misc_constants import *
......
53 55

  
54 56
print("You can now control the browser through 'driver' object")
55 57

  
58
# Here we enable readline-enhanced editing:
59
# https://stackoverflow.com/questions/35115208/is-there-any-way-to-combine-readline-rlcompleter-and-interactiveconsole-in-pytho#answer-35116399
60
readline.parse_and_bind('tab: complete');
61
console_locals = globals()
62
readline.set_completer(Completer(console_locals).complete)
56 63
code.InteractiveConsole(locals=globals()).interact()
57 64

  
58 65
driver.quit()

Also available in: Unified diff