missingnotice: Implement run()
The bots working sequence, using previously implemented methods to update the list of missing notices Issue #64 (#64)
This commit is contained in:
@@ -29,6 +29,8 @@ import pywikibot
|
|||||||
|
|
||||||
import jogobot
|
import jogobot
|
||||||
|
|
||||||
|
from lib.redfam import RedFamWorker
|
||||||
|
|
||||||
|
|
||||||
class MissingNoticeBot(pywikibot.bot.Bot):
|
class MissingNoticeBot(pywikibot.bot.Bot):
|
||||||
"""
|
"""
|
||||||
@@ -47,10 +49,24 @@ ON `cl_from` = `page_id`
|
|||||||
|
|
||||||
def __init__( self, genFactory, **kwargs ):
|
def __init__( self, genFactory, **kwargs ):
|
||||||
|
|
||||||
|
self.categorized_articles = list()
|
||||||
|
self.page_content = list()
|
||||||
|
|
||||||
super(type(self), self).__init__(**kwargs)
|
super(type(self), self).__init__(**kwargs)
|
||||||
|
|
||||||
def run( self ):
|
def run( self ):
|
||||||
pass
|
# query articles containing notice
|
||||||
|
self.categorized_articles = type(self).get_categorized_articles()
|
||||||
|
|
||||||
|
# iterate open redfams
|
||||||
|
for redfam in RedFamWorker.gen_open():
|
||||||
|
links = self.treat_open_redfam(redfam)
|
||||||
|
|
||||||
|
if links:
|
||||||
|
self.page_content.append( self.format_row( links ) )
|
||||||
|
|
||||||
|
# Update page content
|
||||||
|
self.update_page()
|
||||||
|
|
||||||
def treat_open_redfam( self, redfam ):
|
def treat_open_redfam( self, redfam ):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user