removed stupid chainging stuff. what is this, jQuery?
This commit is contained in:
parent
68cbbdcb54
commit
86b819bd11
@ -11,12 +11,20 @@ class Recipe(filters.Filter):
|
|||||||
self.rejected = []
|
self.rejected = []
|
||||||
|
|
||||||
def get_filters(self):
|
def get_filters(self):
|
||||||
|
|
||||||
filters = []
|
filters = []
|
||||||
|
|
||||||
for filter_ in self._filter_args:
|
for filter_ in self._filter_args:
|
||||||
|
|
||||||
|
# check to see if this is a filter or a recipe
|
||||||
|
|
||||||
if hasattr(filter_, 'get_filters'):
|
if hasattr(filter_, 'get_filters'):
|
||||||
|
# load filters from child recipe
|
||||||
filters.extend(filter_.get_filters())
|
filters.extend(filter_.get_filters())
|
||||||
|
|
||||||
else:
|
else:
|
||||||
filters.append(filter_)
|
filters.append(filter_)
|
||||||
|
|
||||||
return filters
|
return filters
|
||||||
|
|
||||||
def run(self, source):
|
def run(self, source):
|
||||||
@ -40,13 +48,13 @@ class Recipe(filters.Filter):
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass # don't care if there isn't a done method
|
pass # don't care if there isn't a done method
|
||||||
|
|
||||||
return self
|
|
||||||
|
|
||||||
def run_recipe(source, *filter_args):
|
def run_recipe(source, *filter_args):
|
||||||
""" Process data, taking it from a source and applying any number of filters
|
""" Process data, taking it from a source and applying any number of filters
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return Recipe(*filter_args).run(source)
|
r = Recipe(*filter_args)
|
||||||
|
r.run(source)
|
||||||
|
return r
|
||||||
|
|
||||||
|
|
||||||
# experiment with threading - do not use
|
# experiment with threading - do not use
|
||||||
|
Loading…
Reference in New Issue
Block a user