diff --git a/bots/missingnotice.py b/bots/missingnotice.py index 3006a6b..31a5445 100644 --- a/bots/missingnotice.py +++ b/bots/missingnotice.py @@ -49,7 +49,32 @@ ON `cl_from` = `page_id` pass def run( self ): - print(type(self).get_categorized_articles() ) + pass + + def treat_open_redfam( self, redfam ): + """ + Works on current open redfam + + @param redfam Redfam to work on + @type redfam.RedFamWorker + + @returns Tuple of disclink and list of articles missing notice or None + @rtype ( str, list(str*) ) or None + """ + + # Check if related disc section exist + if not redfam.disc_section_exists(): + return None + + # Get links for articles without notice + links = self.treat_articles( redfam.article_generator( + filter_existing=True, filter_redirects=True ) ) + + # No articles without notice + if not links: + return None + + return ( redfam.get_disc_link(as_link=True), links ) def treat_articles(self, articles): """