changeset 370:388ee8fa5664

fixed raw SHOW bug
author catherine@cordelia
date Mon, 06 Jul 2009 09:03:55 -0400
parents 15ba1cb88e4c
children e0750f7967d7
files sqlpython/sqlpyPlus.py sqlpython/sqlpython.py
diffstat 2 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/sqlpython/sqlpyPlus.py	Mon Jul 06 08:48:27 2009 -0400
+++ b/sqlpython/sqlpyPlus.py	Mon Jul 06 09:03:55 2009 -0400
@@ -347,7 +347,7 @@
     def __init__(self):
         sqlpython.sqlpython.__init__(self)
         self.binds = CaselessDict()
-        self.settable += 'autobind bloblimit colors commit_on_exit maxfetch maxtselctrows rows_remembered scan serveroutput sql_echo timeout heading wildsql'.split()
+        self.settable += 'autobind bloblimit colors commit_on_exit maxfetch maxtselctrows rows_remembered scan serveroutput sql_echo timeout heading wildsql version'.split()
         self.settable.remove('case_insensitive')
         self.settable.sort()
         self.stdoutBeforeSpool = sys.stdout
@@ -363,6 +363,7 @@
         self.result_history = []
         self.rows_remembered = 10000
         self.bloblimit = 5
+        self.version = 'SQLPython %s' % sqlpython.__version__
         self.pystate = {'r': [], 'binds': self.binds, 'substs': self.substvars}
         
     # overrides cmd's parseline
@@ -879,13 +880,15 @@
                            value FROM v$parameter WHERE name LIKE '%%%s%%';""" % paramname)
         else:
             argpieces = arg.lower().split()
-            flagless_argpieces = [a for a in argpieces if not a.startswith('-')]
-            for (kwd, shortcut) in (('ind', '\\di'), ('schema', '\\dn'), ('tablesp', '\\db'), 
-                                    ('trig', '\\dt'), ('view', '\\dv'), ('cons', '\\dc'),
-                                    ('comm', '\\dd'), ('ref', 'ref')):
-                if flagless_argpieces[0].lower().startswith(kwd):
-                    return self._show_shortcut(shortcut, argpieces)
+            argpieces = [a for a in argpieces if not a.startswith('-')]
             try:
+                for (kwd, shortcut) in (
+                        ('ind', '\\di'), ('schema', '\\dn'), 
+                        ('tablesp', '\\db'), ('trig', '\\dt'), 
+                        ('view', '\\dv'), ('cons', '\\dc'),
+                        ('comm', '\\dd'), ('ref', 'ref')):
+                    if argpieces[0].lower().startswith(kwd):
+                        return self._show_shortcut(shortcut, argpieces)
                 if argpieces[0][:3] == 'err':
                     return self._show_errors(all_users=False, limit=1, targets=argpieces[1:])
                 elif (argpieces[0], argpieces[1][:3]) == ('all','err'):
--- a/sqlpython/sqlpython.py	Mon Jul 06 08:48:27 2009 -0400
+++ b/sqlpython/sqlpython.py	Mon Jul 06 09:03:55 2009 -0400
@@ -10,7 +10,7 @@
 
 import cmd2,getpass,binascii,cx_Oracle,re,os
 import sqlpyPlus, sqlalchemy, pyparsing
-__version__ = '1.6.6'    
+__version__ = '1.6.7'    
 
 class Parser(object):
     comment_def = "--" + ~ ('-' + pyparsing.CaselessKeyword('begin')) + pyparsing.ZeroOrMore(pyparsing.CharsNotIn("\n"))