iwla

iwla Commit Details

Date:2014-12-03 11:29:05 (6 years 7 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:269b8e54de98ad9811be7ad4b2257d022a10f169
Parents: 9c82c61cf8acb63e387a6b2513e1b3554eb765b2
Message:Add minimal conf values requirements for main

Changes:
Miplugin.py (2 diffs)
Miwla.py (1 diff)

File differences

iplugin.py
3232
3333
3434
35
36
37
38
39
40
41
42
3543
3644
3745
......
6270
6371
6472
65
66
67
68
69
70
71
72
73
73
74
7475
7576
7677
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 = {}
#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()
iwla.py
497497
498498
499499
500
501
502
503
500504
501505
502506
iwla = IWLA()
required_conf = ['analyzed_filename', 'domain_name']
if not validConfRequirements(required_conf, iwla, 'Main Conf'):
sys.exit(0)
if args.stdin:
iwla.start(sys.stdin)
else:

Archive Download the corresponding diff file

Branches

Tags