mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-10-25 15:06:20 +00:00
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
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user