diff options
| author | Jason Keene | 2011-08-20 01:30:27 -0400 |
|---|---|---|
| committer | Jason Keene | 2011-08-20 01:30:27 -0400 |
| commit | ec688d299517459d37904b61b19ba5b3e262aa61 (patch) | |
| tree | 2fb8d7b74cec005febce775cb6d4b1a438c78563 /debug_toolbar/utils/sqlparse/engine/__init__.py | |
| parent | d55d8192dff37c9c025e9d97813d40f2081d69d7 (diff) | |
| parent | 6e3d9da54cffb41461c6778c55b0461410a9655c (diff) | |
| download | django-debug-toolbar-ec688d299517459d37904b61b19ba5b3e262aa61.tar.bz2 | |
Merge branch 'master' of git://github.com/django-debug-toolbar/django-debug-toolbar into jquery_no_conflict_issue
Diffstat (limited to 'debug_toolbar/utils/sqlparse/engine/__init__.py')
| -rw-r--r-- | debug_toolbar/utils/sqlparse/engine/__init__.py | 20 |
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 - |
