Allow commandline to load without readline for non-Unix systems
[hooke.git] / hooke / ui / commandline.py
index 02aa9acccc5b85dba2b4ecf432bb23e5db1e0364..4533217222eb467bab441d29e1f62f6ff210f121 100644 (file)
@@ -23,7 +23,11 @@ line.
 import codecs
 import cmd
 import optparse
-import readline # including readline makes cmd.Cmd.cmdloop() smarter
+try:
+    import readline # including readline makes cmd.Cmd.cmdloop() smarter
+except ImportError, e:
+    import logging
+    logging.warn('Could not import readline, bash-like line editing disabled.')
 import shlex
 
 from ..command import CommandExit, Exit, Command, Argument, StoreValue