Allow general plugin type to return list

svn: r16195
This commit is contained in:
Doug Blank 2010-11-16 11:46:35 +00:00
parent 24ba4f8693
commit a581b61cfd

View File

@ -76,11 +76,15 @@ class FilterList(object):
if plugins: if plugins:
plugin_filters = [] plugin_filters = []
try: try:
plugin_filters = [plug for plug in [plug(namespace) for plug in plugins:
if callable(plug) if callable(plug):
else plug plug = plug(namespace)
for plug in plugins] if plug:
if plug is not None] if isinstance(plug, (list, tuple)):
for subplug in plug:
plugin_filters.append(subplug)
else:
plugin_filters.append(plug)
except: except:
import traceback import traceback
traceback.print_exc() traceback.print_exc()