From f021a132029d6c6f5ea32e2b74c0d3000e5a32e9 Mon Sep 17 00:00:00 2001 From: Jonathan Golder Date: Tue, 18 Sep 2018 15:42:02 +0200 Subject: [PATCH] missingnotice: Implement run() The bots working sequence, using previously implemented methods to update the list of missing notices Issue #64 (https://git.golderweb.de/wiki/jogobot-red/issues/64) --- bots/missingnotice.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bots/missingnotice.py b/bots/missingnotice.py index 77aaa35..3d19787 100644 --- a/bots/missingnotice.py +++ b/bots/missingnotice.py @@ -29,6 +29,8 @@ import pywikibot import jogobot +from lib.redfam import RedFamWorker + class MissingNoticeBot(pywikibot.bot.Bot): """ @@ -47,10 +49,24 @@ ON `cl_from` = `page_id` def __init__( self, genFactory, **kwargs ): + self.categorized_articles = list() + self.page_content = list() + super(type(self), self).__init__(**kwargs) 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 ): """