Add minimal conf values requirements for main
This commit is contained in:
parent
9c82c61cf8
commit
269b8e54de
19
iplugin.py
19
iplugin.py
|
@ -32,6 +32,14 @@ class IPlugin(object):
|
|||
def hook(self):
|
||||
pass
|
||||
|
||||
def validConfRequirements(conf_requirements, iwla, plugin_path):
|
||||
for r in conf_requirements:
|
||||
if iwla.getConfValue(r, None) is None:
|
||||
print '\'%s\' conf value required for %s' % (r, plugin_path)
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def preloadPlugins(plugins, iwla):
|
||||
cache_plugins = {}
|
||||
|
||||
|
@ -62,15 +70,8 @@ def preloadPlugins(plugins, iwla):
|
|||
#print 'Load plugin %s' % (plugin_name)
|
||||
|
||||
conf_requirements = plugin.getConfRequirements()
|
||||
|
||||
requirement_validated = True
|
||||
for r in conf_requirements:
|
||||
conf_value = iwla.getConfValue(r, None)
|
||||
if conf_value is None:
|
||||
print '\'%s\' conf value required for %s' % (r, plugin_path)
|
||||
requirement_validated = False
|
||||
break
|
||||
if not requirement_validated: continue
|
||||
if not validConfRequirements(conf_requirements, iwla, plugin_path):
|
||||
continue
|
||||
|
||||
requirements = plugin.getRequirements()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user