Rework conf in plugins

This commit is contained in:
2014-11-24 21:42:57 +01:00
parent 549c0e5d97
commit d5db763b48
7 changed files with 19 additions and 25 deletions

View File

@@ -2,16 +2,10 @@ import importlib
import inspect
import traceback
import default_conf as conf
import conf as _
conf.__dict__.update(_.__dict__)
del _
class IPlugin(object):
def __init__(self, iwla, conf):
def __init__(self, iwla):
self.iwla = iwla
self.conf = conf
self.requires = []
self.API_VERSION = 1
self.ANALYSIS_CLASS = 'HTTP'
@@ -24,12 +18,6 @@ class IPlugin(object):
return False
return True
def getConfValue(self, key, default):
if not key in dir(self.conf):
return default
else:
return self.conf.__dict__[key]
def getRequirements(self):
return self.requires
@@ -58,7 +46,7 @@ def preloadPlugins(plugins, iwla):
print 'No plugin defined in %s' % (plugin_path)
continue
plugin = classes[0](iwla, conf)
plugin = classes[0](iwla)
plugin_name = plugin.__class__.__name__
if not plugin.isValid(iwla.ANALYSIS_CLASS, iwla.API_VERSION):