diff sqlpython.py @ 40:1fb9f7dee7d8

tearing out cmd2
author devlinjs@FA7CZA6N1254998.wrightpatterson.afmc.ds.af.mil
date Fri, 18 Jan 2008 15:07:10 -0500
parents 2776755a3a7e
children 33c9bc61db66
line wrap: on
line diff
--- a/sqlpython.py	Thu Jan 03 13:48:50 2008 -0500
+++ b/sqlpython.py	Fri Jan 18 15:07:10 2008 -0500
@@ -14,7 +14,7 @@
     # complication! separate sessions ->
     # separate transactions !!!!!
     # also: timeouts, other session failures
-	    
+
 class sqlpython(cmd2.Cmd):
     '''A python module to reproduce Oracle's command line with focus on customization and extention'''
 
@@ -120,24 +120,8 @@
     do_q = do_quit
     do_exit = do_quit
 
-stmtEndSearchString = r'(.*)(%s)\s*(\d+)?\s*$' % sqlpython.terminatorSearchString
-stmtEndFinder = re.compile(stmtEndSearchString, re.MULTILINE | re.DOTALL)
-prompt2 = ' > '
-
-def finishStatement(firstline):
-    lines = [firstline]
-    while 1:
-        m = stmtEndFinder.search(lines[-1])
-        if m:
-            return '\n'.join(lines)
-        lines.append(raw_input(prompt2))
-
-def findTerminator(statement):
-    m = stmtEndFinder.search(statement)
-    if m:
-        return m.groups()
-    else:
-        return statement, None, None
+    stmtEndSearchString = r'(.*)(%s)\s*(\d+)?\s*$' % sqlpython.terminatorSearchString
+    statementEndPattern = re.compile(stmtEndSearchString, re.MULTILINE | re.DOTALL)
     
 def pmatrix(rows,desc,maxlen=30):
     '''prints a matrix, used by sqlpython to print queries' result sets'''