summaryrefslogtreecommitdiff
path: root/sqlparse/pipeline.py
diff options
context:
space:
mode:
authorVik <vmuriart@users.noreply.github.com>2016-06-06 06:29:25 -0700
committerVik <vmuriart@users.noreply.github.com>2016-06-06 06:29:25 -0700
commitb9d81ac4fe49114f57dc33c0d635f99ff56e62f2 (patch)
tree88642eeb84d318511191a822fd781b44e1d63df1 /sqlparse/pipeline.py
parentc6a5e7ac2a5ecc993f4e5292ab16e6df6b84f26c (diff)
parent5747015634a39191511de8db576f2cd0aa5eafc9 (diff)
downloadsqlparse-b9d81ac4fe49114f57dc33c0d635f99ff56e62f2.tar.gz
Merge pull request #251 from andialbrecht/filters_sql
Update Filters sql
Diffstat (limited to 'sqlparse/pipeline.py')
-rw-r--r--sqlparse/pipeline.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/sqlparse/pipeline.py b/sqlparse/pipeline.py
deleted file mode 100644
index 34dad19..0000000
--- a/sqlparse/pipeline.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2011 Jesus Leganes "piranna", piranna@gmail.com
-#
-# This module is part of python-sqlparse and is released under
-# the BSD License: http://www.opensource.org/licenses/bsd-license.php.
-
-from types import GeneratorType
-
-
-class Pipeline(list):
- """Pipeline to process filters sequentially"""
-
- def __call__(self, stream):
- """Run the pipeline
-
- Return a static (non generator) version of the result
- """
-
- # Run the stream over all the filters on the pipeline
- for filter in self:
- # Functions and callable objects (objects with '__call__' method)
- if callable(filter):
- stream = filter(stream)
-
- # Normal filters (objects with 'process' method)
- else:
- stream = filter.process(None, stream)
-
- # If last filter return a generator, staticalize it inside a list
- if isinstance(stream, GeneratorType):
- return list(stream)
- return stream