changeset 253:e4b741d882b7

removing obsolete colnames, sql_format_itm, redefine enumerate for Py < 2.3
author catherine@Elli.myhome.westell.com
date Thu, 12 Mar 2009 21:06:13 -0400
parents ae1d89f09a88
children b61e21386383
files sqlpython/sqlpyPlus.py
diffstat 1 files changed, 0 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/sqlpython/sqlpyPlus.py	Thu Mar 12 21:02:07 2009 -0400
+++ b/sqlpython/sqlpyPlus.py	Thu Mar 12 21:06:13 2009 -0400
@@ -203,10 +203,6 @@
 """
 }
 
-if float(sys.version[:3]) < 2.3:
-    def enumerate(lst):
-        return zip(range(len(lst)), lst)
-
 class SoftwareSearcher(object):
     def __init__(self, softwareList, purpose):
         self.softwareList = softwareList
@@ -242,7 +238,6 @@
                or customize %s to make it aware of yours.
 Looked for these programs:
 %s""" % (self.purpose, __file__, "\n".join([s[0] for s in self.softwareList])))
-    #v2.4: %s""" % (self.purpose, __file__, "\n".join(s[0] for s in self.softwareList)))
 
 softwareLists = {
     'diff/merge': [  
@@ -316,7 +311,6 @@
         return dict.pop(self, key.lower(), def_val)
 
 class Parser(object):
-    #comment_def = "--" + pyparsing.ZeroOrMore(pyparsing.CharsNotIn("\n"))    
     comment_def = "--" + ~ ('-' + pyparsing.CaselessKeyword('begin')) + pyparsing.ZeroOrMore(pyparsing.CharsNotIn("\n"))    
     def __init__(self, scanner, retainSeparator=True):
         self.scanner = scanner
@@ -430,21 +424,6 @@
         for (scchar, scto) in self.shortcuts.items():
             print '%s: %s' % (scchar, scto)
 
-    def colnames(self):
-        return [d[0] for d in curs.description]
-
-    def sql_format_itm(self, itm, needsquotes):
-        if itm is None:
-            return 'NULL'
-        if needsquotes:
-            return "'%s'" % str(itm)
-        return str(itm)
-    tableNameFinder = re.compile(r'from\s+([\w$#_"]+)', re.IGNORECASE | re.MULTILINE | re.DOTALL)          
-    inputStatementFormatters = {
-        cx_Oracle.STRING: "'%s'",
-        cx_Oracle.DATETIME: "TO_DATE('%s', 'YYYY-MM-DD HH24:MI:SS')"}
-    inputStatementFormatters[cx_Oracle.CLOB] = inputStatementFormatters[cx_Oracle.STRING]
-    inputStatementFormatters[cx_Oracle.TIMESTAMP] = inputStatementFormatters[cx_Oracle.DATETIME]    
     def output(self, outformat, rowlimit):
         self.tblname = self.tableNameFinder.search(self.curs.statement).group(1)
         self.colnames = [d[0] for d in self.curs.description]