changeset 39:5d29e6a21c6f

ready to package cmd2
author devlinjs@FA7CZA6N1254998.wrightpatterson.afmc.ds.af.mil
date Thu, 03 Jan 2008 13:48:50 -0500
parents ed1f390c142d
children 1fb9f7dee7d8
files cmd2.py sqlpyPlus.py
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- 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):