Remove iwla parameter in hook functions
This commit is contained in:
@@ -13,8 +13,8 @@ class IWLAPostAnalysisReverseDNS(IPlugin):
|
||||
socket.setdefaulttimeout(timeout)
|
||||
return True
|
||||
|
||||
def hook(self, iwla):
|
||||
hits = iwla.getValidVisitors()
|
||||
def hook(self):
|
||||
hits = self.iwla.getValidVisitors()
|
||||
for (k, hit) in hits.items():
|
||||
if hit.get('dns_analysed', False): continue
|
||||
try:
|
||||
|
@@ -6,9 +6,9 @@ class IWLAPostAnalysisTopVisitors(IPlugin):
|
||||
super(IWLAPostAnalysisTopVisitors, self).__init__(iwla)
|
||||
self.API_VERSION = 1
|
||||
|
||||
def hook(self, iwla):
|
||||
hits = iwla.getValidVisitors()
|
||||
stats = iwla.getMonthStats()
|
||||
def hook(self):
|
||||
hits = self.iwla.getValidVisitors()
|
||||
stats = self.iwla.getMonthStats()
|
||||
top_bandwidth = [(k,hits[k]['bandwidth']) for k in hits.keys()]
|
||||
top_bandwidth = sorted(top_bandwidth, key=lambda t: t[1], reverse=True)
|
||||
stats['top_visitors'] = [hits[h[0]] for h in top_bandwidth[:10]]
|
||||
|
Reference in New Issue
Block a user