comparison sqlpyPlus.py @ 113:d48034a42b26

slash-endings working
author catherine@Elli.myhome.westell.com
date Mon, 23 Jun 2008 22:01:51 -0400
parents 5e57765073f4
children c1c05670b4e5
comparison
equal deleted inserted replaced
112:5e57765073f4 113:d48034a42b26
477 pyparsing.Literal('\\S') + rowlimit_pattern, 477 pyparsing.Literal('\\S') + rowlimit_pattern,
478 pyparsing.Literal('\\c') + rowlimit_pattern, 478 pyparsing.Literal('\\c') + rowlimit_pattern,
479 pyparsing.Literal('\\C') + rowlimit_pattern, 479 pyparsing.Literal('\\C') + rowlimit_pattern,
480 pyparsing.Literal('\\h') + rowlimit_pattern, 480 pyparsing.Literal('\\h') + rowlimit_pattern,
481 pyparsing.Literal('\\t') + rowlimit_pattern, 481 pyparsing.Literal('\\t') + rowlimit_pattern,
482 '\n\n' 482 pyparsing.LineEnd() + '/' + pyparsing.LineEnd()
483 ] 483 ]
484 tableNameFinder = re.compile(r'from\s+([\w$#_"]+)', re.IGNORECASE | re.MULTILINE | re.DOTALL) 484 tableNameFinder = re.compile(r'from\s+([\w$#_"]+)', re.IGNORECASE | re.MULTILINE | re.DOTALL)
485 def output(self, outformat, rowlimit): 485 def output(self, outformat, rowlimit):
486 self.tblname = self.tableNameFinder.search(self.curs.statement).group(1) 486 self.tblname = self.tableNameFinder.search(self.curs.statement).group(1)
487 self.colnames = [d[0] for d in self.curs.description] 487 self.colnames = [d[0] for d in self.curs.description]
538 terminator = self.commmand_terminator_finder(self.query) 538 terminator = self.commmand_terminator_finder(self.query)
539 if terminator: 539 if terminator:
540 (self.query, terminator, dummy) = terminator 540 (self.query, terminator, dummy) = terminator
541 else: 541 else:
542 terminator = [';'] 542 terminator = [';']
543 if len(terminator) == 1: 543 try:
544 terminator, rowlimit = terminator[0], int(terminator[1])
545 except (IndexError, ValueError):
544 terminator, rowlimit = terminator[0], 0 546 terminator, rowlimit = terminator[0], 0
545 else:
546 terminator, rowlimit = terminator[0], int(terminator[1])
547 if override_terminator: 547 if override_terminator:
548 terminator = override_terminator 548 terminator = override_terminator
549 try: 549 try:
550 self.varsUsed = findBinds(self.query, self.binds, bindVarsIn) 550 self.varsUsed = findBinds(self.query, self.binds, bindVarsIn)
551 self.curs.execute(self.query, self.varsUsed) 551 self.curs.execute(self.query, self.varsUsed)