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:
plugin_filters = []
try:
plugin_filters = [plug for plug in [plug(namespace)
if callable(plug)
else plug
for plug in plugins]
if plug is not None]
for plug in plugins:
if callable(plug):
plug = plug(namespace)
if plug:
if isinstance(plug, (list, tuple)):
for subplug in plug:
plugin_filters.append(subplug)
else:
plugin_filters.append(plug)
except:
import traceback
traceback.print_exc()