diff sqlpyPlus.py @ 92:fa8c9eb8908f

accepting command-line args
author catherine@cordelia
date Sun, 25 May 2008 01:35:08 -0400
parents 51e1fe3adf0e
children 5df8e2477ca3
line wrap: on
line diff
--- a/sqlpyPlus.py	Tue May 20 21:58:55 2008 -0400
+++ b/sqlpyPlus.py	Sun May 25 01:35:08 2008 -0400
@@ -341,7 +341,7 @@
 
 class sqlpyPlus(sqlpython.sqlpython):
     defaultExtension = 'sql'
-    shortcuts = {'?': 'help', '@': 'getrun', '!': 'shell', ':': 'setbind', '\\': 'psql'}    
+    sqlpython.sqlpython.shortcuts.update({':': 'setbind', '\\': 'psql', '@': '_load'})
     multilineCommands = '''select insert update delete tselect
                       create drop alter'''.split()
     defaultFileName = 'afiedt.buf'
@@ -372,6 +372,8 @@
             print 'Not connected.'
             return '', '', ''
         return cmd, arg, line
+    
+    do__load = Cmd.do_load
 
     def onecmd_plus_hooks(self, line):                          
         line = self.precmd(line)
@@ -685,9 +687,6 @@
     bufferPosPattern = re.compile('\d+')
     rangeIndicators = ('-',':')
 
-    def do_getrun(self, fname):
-        'Brings SQL commands from a file to the in-memory SQL buffer, and executes them.'
-        Cmd.do_load(self, fname)
     def do_psql(self, arg):
         '''Shortcut commands emulating psql's backslash commands.
 
@@ -696,7 +695,7 @@
         \e edit
         \g run
         \h help
-        \i getrun
+        \i load
         \o spool
         \p list
         \q quit