# HG changeset patch # User devlinjs@FA7CZA6N1254998.wrightpatterson.afmc.ds.af.mil # Date 1199386130 18000 # Node ID 5d29e6a21c6ffa835df92da0ebe5205dcac01ad4 # Parent ed1f390c142dc6e9a68ffb1e41c641f3f5f5484a ready to package cmd2 diff -r ed1f390c142d -r 5d29e6a21c6f cmd2.py --- a/cmd2.py Thu Jan 03 13:23:06 2008 -0500 +++ b/cmd2.py Thu Jan 03 13:48:50 2008 -0500 @@ -12,10 +12,11 @@ todo: edited commands end with "EOF". Hmm. -flags -> +example of flag usage +> to dump to file """ import cmd, re, os, sys +import flagReader class Cmd(cmd.Cmd): caseInsensitive = True @@ -46,6 +47,11 @@ cmd.Cmd.__init__(self, *args, **kwargs) self.history = History() + def do_shortcuts(self, args): + """Lists single-key shortcuts available.""" + result = "\n".join('%s: %s' % (sc[0], sc[1]) for sc in self.shortcuts.items()) + self.stdout.write("Single-key shortcuts for other commands:\n%s\n" % (result)) + def onecmd(self, line): """Interpret the argument as though it had been typed in response to the prompt. diff -r ed1f390c142d -r 5d29e6a21c6f sqlpyPlus.py --- a/sqlpyPlus.py Thu Jan 03 13:23:06 2008 -0500 +++ b/sqlpyPlus.py Thu Jan 03 13:48:50 2008 -0500 @@ -186,7 +186,8 @@ """ } -import sys, os, re, sqlpython, cx_Oracle, pyparsing, flagReader +import sys, os, re, sqlpython, cx_Oracle, pyparsing +from cmd2 import flagReader if float(sys.version[:3]) < 2.3: def enumerate(lst):