Implemented readline support in trs shell.

parent 178f8632
#!/usr/bin/python #!/usr/bin/python
def init_readline():
import os
try:
import readline
except ImportError:
return
histfile = os.path.join(os.path.expanduser("~"), ".trs_hist")
try:
readline.read_history_file(histfile)
except IOError:
pass
import atexit
atexit.register(readline.write_history_file, histfile)
from src.parser import main from src.parser import main
if __name__ == '__main__': if __name__ == '__main__':
init_readline()
main() main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment