Don't evaluate callable data returned from the plugin API
svn: r15790
This commit is contained in:
parent
b62c42d85e
commit
00f738f953
@ -384,14 +384,7 @@ class BasePluginManager(object):
|
|||||||
retval = []
|
retval = []
|
||||||
data = None
|
data = None
|
||||||
for plugin in self.__pgr.general_plugins(category):
|
for plugin in self.__pgr.general_plugins(category):
|
||||||
if callable(plugin.data):
|
data = plugin.data
|
||||||
try:
|
|
||||||
data = plugin.data()
|
|
||||||
except:
|
|
||||||
import traceback
|
|
||||||
traceback.print_exc()
|
|
||||||
else:
|
|
||||||
data = plugin.data
|
|
||||||
try:
|
try:
|
||||||
iter(data)
|
iter(data)
|
||||||
retval.extend(data)
|
retval.extend(data)
|
||||||
@ -416,14 +409,7 @@ class BasePluginManager(object):
|
|||||||
mod = self.load_plugin(plugin)
|
mod = self.load_plugin(plugin)
|
||||||
if hasattr(mod, plugin.process):
|
if hasattr(mod, plugin.process):
|
||||||
process = getattr(mod, plugin.process)
|
process = getattr(mod, plugin.process)
|
||||||
if callable(plugin.data):
|
data = plugin.data
|
||||||
try:
|
|
||||||
data = plugin.data()
|
|
||||||
except:
|
|
||||||
import traceback
|
|
||||||
traceback.print_exc()
|
|
||||||
else:
|
|
||||||
data = plugin.data
|
|
||||||
if data:
|
if data:
|
||||||
try:
|
try:
|
||||||
iter(data)
|
iter(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user