iwla

iwla Commit Details

Date:2015-04-06 17:54:44 (6 years 3 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:ee184f86b5afda1a0258c7311108c8d9eaa01f51
Parents: df78a3f4cbefd3ec26375a6bd4605a6f149fc729
Message:Add has_subclasses checks for iplugins (prevent for loading parent class)

Changes:
Miplugin.py (1 diff)
Mplugins/display/feeds.py (3 diffs)
Mplugins/display/istats_diff.py (1 diff)
Mplugins/display/referers_diff.py (1 diff)

File differences

iplugin.py
7979
8080
8181
82
82
83
8384
8485
8586
8687
8788
8889
90
91
92
93
94
8995
9096
9197
classes = [c for _,c in inspect.getmembers(mod)\
if inspect.isclass(c) and \
issubclass(c, IPlugin) and \
c.__name__ != 'IPlugin'
c.__name__ != 'IPlugin' and \
not c.__subclasses__()
]
if not classes:
logger.warning('No plugin defined in %s' % (plugin_path))
continue
if len(classes) > 1:
logger.warning('More than one class found in %s, loading may fail. Selecting %s' % (plugin_path, classes[0]))
print classes
continue
plugin = classes[0](iwla)
plugin_name = plugin.__class__.__name__
plugins/display/feeds.py
2121
2222
2323
24
2524
2625
2726
......
6059
6160
6261
62
63
6364
6465
6566
......
8889
8990
9091
91
92
9293
9394
9495
from iwla import IWLA
from iplugin import IPlugin
from display import *
from plugins.post_analysis.feeds import IWLAPostAnalysisFeeds
"""
Display hook
return True
def hook(self):
from plugins.post_analysis.feeds import IWLAPostAnalysisFeeds
display = self.iwla.getDisplay()
hits = self.iwla.getCurrentVisists()
nb_feeds_parsers = 0
else:
table.appendRow([address, super_hit['viewed_pages'], super_hit['viewed_hits']])
page.appendBlock(table)
note = DisplayHTMLRaw(self.iwla, ('<small>*%s</small>' % (self.iwla._('Merged feeds parsers'))))
note = DisplayHTMLRaw(self.iwla, ('<small>*%s</small>' % (self.iwla._(u'Merged feeds parsers'))))
page.appendBlock(note)
display.addPage(page)
plugins/display/istats_diff.py
2424
2525
2626
27
27
2828
2929
3030
import logging
"""
Display hook itnerface
Display hook interface
Enlight new and updated statistics
plugins/display/referers_diff.py
5353
5454
5555
56
56
5757
5858
5959
self.requires = ['IWLADisplayReferers']
self.month_stats_key = 'key_phrases'
self.filename = 'key_phrases.html'
self.block_name = u'Key phrases'
self.block_name = self.iwla._(u'Key phrases')
def load(self):
if not self.iwla.getConfValue('create_all_key_phrases_page', True):

Archive Download the corresponding diff file

Branches

Tags