# HG changeset patch # User catherine@Elli.myhome.westell.com # Date 1214272911 14400 # Node ID d48034a42b26a4459ec785f65746ab5888baf4b8 # Parent 5e57765073f4c7d1256e2dc3798b7c22fe9cc727 slash-endings working diff -r 5e57765073f4 -r d48034a42b26 sqlpyPlus.py --- a/sqlpyPlus.py Mon Jun 23 20:52:27 2008 -0400 +++ b/sqlpyPlus.py Mon Jun 23 22:01:51 2008 -0400 @@ -479,7 +479,7 @@ pyparsing.Literal('\\C') + rowlimit_pattern, pyparsing.Literal('\\h') + rowlimit_pattern, pyparsing.Literal('\\t') + rowlimit_pattern, - '\n\n' + pyparsing.LineEnd() + '/' + pyparsing.LineEnd() ] tableNameFinder = re.compile(r'from\s+([\w$#_"]+)', re.IGNORECASE | re.MULTILINE | re.DOTALL) def output(self, outformat, rowlimit): @@ -540,10 +540,10 @@ (self.query, terminator, dummy) = terminator else: terminator = [';'] - if len(terminator) == 1: + try: + terminator, rowlimit = terminator[0], int(terminator[1]) + except (IndexError, ValueError): terminator, rowlimit = terminator[0], 0 - else: - terminator, rowlimit = terminator[0], int(terminator[1]) if override_terminator: terminator = override_terminator try: