diff sqlpyPlus.py @ 20:d6d64c2e3b98

shortcuts
author devlinjs@FA7CZA6N1254998.wrightpatterson.afmc.ds.af.mil
date Wed, 19 Dec 2007 11:49:23 -0500
parents 2776755a3a7e
children 8b55aaa52ce9
line wrap: on
line diff
--- a/sqlpyPlus.py	Wed Dec 19 11:30:13 2007 -0500
+++ b/sqlpyPlus.py	Wed Dec 19 11:49:23 2007 -0500
@@ -365,19 +365,11 @@
         the arguments.  Returns a tuple containing (command, args, line).
         'command' and 'args' may be None if the line couldn't be parsed.	
         Overrides cmd.cmd.parseline to accept variety of shortcuts.."""
-        line = line.strip()
-        if not line:
-            return None, None, line
-        shortcut = self.shortcuts.get(line[0])
-        if shortcut:
-            cmd, arg = shortcut, line[1:].strip()
-        else:
-            i, n = 0, len(line)
-            while i < n and line[i] in self.identchars: i = i+1
-            cmd, arg = line[:i], line[i:].strip()
-        if cmd.lower() in ('select', 'sleect', 'insert', 'update', 'delete', 'describe',
+	
+	cmd, arg. line = sqlpython.parseline(self, line)
+        if cmd in ('select', 'sleect', 'insert', 'update', 'delete', 'describe',
                           'desc', 'comments', 'pull', 'refs', 'desc', 'triggers', 'find') \
-            and not hasattr(self, 'curs'):
+	       and not hasattr(self, 'curs'):
             print 'Not connected.'
             return '', '', ''
         return cmd, arg, line
@@ -426,7 +418,6 @@
         for (scchar, scto) in self.shortcuts.items():
             print '%s: %s' % (scchar, scto)
 
-
     def colnames(self):
         return [d[0] for d in curs.description]
 
@@ -689,10 +680,6 @@
     def do_resolve(self, arg):
         print self.resolve(arg)
         
-    def do_shell(self, arg):
-        'execute a command as if at the OS prompt.'
-        os.system(arg)
-        
     def spoolstop(self):
         if self.spoolFile:
             sys.stdout = self.stdoutBeforeSpool