Commit 9f5008fd authored by Shane Kerr's avatar Shane Kerr
Browse files

Use readline if supported on the system, otherwise stdin.



git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1441 e5f2f494-b856-4b98-b285-d166d9295462
parent 6fe5d6fe
......@@ -14,7 +14,6 @@
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import sys
import readline
from cmd import Cmd
from bindctl.exception import *
from bindctl.moduleinfo import *
......@@ -38,6 +37,13 @@ try:
except ImportError:
from bindctl.mycollections import OrderedDict
# if we have readline support, use that, otherwise use normal stdio
try:
import readline
my_readline = readline.get_line_buffer
except ImportError:
my_readline = sys.stding.readline
CONST_BINDCTL_HELP = """BindCtl, version 0.1
usage: <module name> <command name> [param1 = value1 [, param2 = value2]]
......@@ -320,7 +326,7 @@ class BindCmdInterpreter(Cmd):
if 0 == state:
text = text.strip()
hints = []
cur_line = readline.get_line_buffer()
cur_line = my_readline()
try:
cmd = BindCmdParse(cur_line)
if not cmd.params and text:
......
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