Browse Source

missingnotice: Implement treat_redfam

For each redfam, we need to check weather related redundance discussion
exists and if there are missing notices. For those redfams return links
to discussion and articles missing notice.

Issue #64 (https://git.golderweb.de/wiki/jogobot-red/issues/64)
develop
Jonathan Golder 6 years ago
parent
commit
68b81b1111
  1. 27
      bots/missingnotice.py

27
bots/missingnotice.py

@ -49,7 +49,32 @@ ON `cl_from` = `page_id`
pass pass
def run( self ): 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): def treat_articles(self, articles):
""" """

Loading…
Cancel
Save