From: W. Trevor King Date: Tue, 10 Aug 2010 10:44:50 +0000 (-0400) Subject: Allow commandline to load without readline for non-Unix systems X-Git-Url: http://git.tremily.us/?p=hooke.git;a=commitdiff_plain;h=53ea9a32b6c7c1588bfff6c365dc4f3b50c88fc1;ds=sidebyside Allow commandline to load without readline for non-Unix systems --- diff --git a/hooke/ui/commandline.py b/hooke/ui/commandline.py index 02aa9ac..4533217 100644 --- a/hooke/ui/commandline.py +++ b/hooke/ui/commandline.py @@ -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