aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/utils/sqlparse/engine/__init__.py
diff options
context:
space:
mode:
authorRob Hudson2011-08-09 10:26:42 -0700
committerRob Hudson2011-08-09 10:26:42 -0700
commit6e3d9da54cffb41461c6778c55b0461410a9655c (patch)
tree1def7369528baac4757493eefb846319c0364323 /debug_toolbar/utils/sqlparse/engine/__init__.py
parentfee623f56f1429888b1b31ff56889debeda8edfb (diff)
downloaddjango-debug-toolbar-6e3d9da54cffb41461c6778c55b0461410a9655c.tar.bz2
Updated sqlparse to v0.1.3
Diffstat (limited to 'debug_toolbar/utils/sqlparse/engine/__init__.py')
-rw-r--r--debug_toolbar/utils/sqlparse/engine/__init__.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/debug_toolbar/utils/sqlparse/engine/__init__.py b/debug_toolbar/utils/sqlparse/engine/__init__.py
index cae0793..e838a3e 100644
--- a/debug_toolbar/utils/sqlparse/engine/__init__.py
+++ b/debug_toolbar/utils/sqlparse/engine/__init__.py
@@ -5,9 +5,7 @@
"""filter"""
-import re
-
-from debug_toolbar.utils.sqlparse import lexer, SQLParseError
+from debug_toolbar.utils.sqlparse import lexer
from debug_toolbar.utils.sqlparse.engine import grouping
from debug_toolbar.utils.sqlparse.engine.filter import StatementFilter
@@ -42,8 +40,8 @@ class FilterStack(object):
stream = lexer.tokenize(sql)
# Process token stream
if self.preprocess:
- for filter_ in self.preprocess:
- stream = filter_.process(self, stream)
+ for filter_ in self.preprocess:
+ stream = filter_.process(self, stream)
if (self.stmtprocess or self.postprocess or self.split_statements
or self._grouping):
@@ -51,6 +49,7 @@ class FilterStack(object):
stream = splitter.process(self, stream)
if self._grouping:
+
def _group(stream):
for stmt in stream:
grouping.group(stmt)
@@ -58,23 +57,24 @@ class FilterStack(object):
stream = _group(stream)
if self.stmtprocess:
- def _run(stream):
+
+ def _run1(stream):
ret = []
for stmt in stream:
for filter_ in self.stmtprocess:
filter_.process(self, stmt)
ret.append(stmt)
return ret
- stream = _run(stream)
+ stream = _run1(stream)
if self.postprocess:
- def _run(stream):
+
+ def _run2(stream):
for stmt in stream:
stmt.tokens = list(self._flatten(stmt.tokens))
for filter_ in self.postprocess:
stmt = filter_.process(self, stmt)
yield stmt
- stream = _run(stream)
+ stream = _run2(stream)
return stream
-