From: W. Trevor King Date: Sat, 7 Aug 2010 16:50:17 +0000 (-0400) Subject: Fixed empytline -> emptyline typo in hooke.ui.commandline. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ff9ac019edc1c957443d5588f0c3823cc41fa659;p=hooke.git Fixed empytline -> emptyline typo in hooke.ui.commandline. Also use cmd and args vs. old argv[0], argv[1:] in parseline for clarity. --- diff --git a/hooke/ui/commandline.py b/hooke/ui/commandline.py index 4baaf85..02aa9ac 100644 --- a/hooke/ui/commandline.py +++ b/hooke/ui/commandline.py @@ -423,11 +423,13 @@ class HookeCmd (cmd.Cmd): argv = shlex.split(line, comments=True, posix=True) if len(argv) == 0: return None, None, '' # return an empty line - elif argv[0] == '?': - argv[0] = 'help' - elif argv[0] == '!': - argv[0] = 'system' - return argv[0], argv[1:], line + cmd = argv[0] + args = argv[1:] + if cmd == '?': + cmd = 'help' + elif cmd == '!': + cmd = 'system' + return cmd, args, line def do_help(self, arg): """Wrap Cmd.do_help to handle our .parseline argument list. @@ -436,7 +438,7 @@ class HookeCmd (cmd.Cmd): return cmd.Cmd.do_help(self, '') return cmd.Cmd.do_help(self, arg[0]) - def empytline(self): + def emptyline(self): """Override Cmd.emptyline to not do anything. Repeating the last non-empty command seems unwise. Explicit @@ -444,6 +446,7 @@ class HookeCmd (cmd.Cmd): """ pass + class CommandLine (UserInterface): """Command line interface. Simple and powerful. """