missingnotice: Implement article selection

Issue #64 (#64)
This commit is contained in:
2018-09-18 13:27:46 +02:00
parent 99adad873e
commit 95af95aca6
2 changed files with 57 additions and 0 deletions

View File

@@ -51,6 +51,28 @@ ON `cl_from` = `page_id`
def run( self ):
print(type(self).get_categorized_articles() )
def treat_articles(self, articles):
"""
Iterates over given articles and checks weather them are included in
self.categorized_articles (contain the notice)
@param articles Articles to check
@type articles iterable of pywikibot.page() objects
@returns Possibly empty list of wikitext links ("[[article]]")
@rtype list
"""
links = list()
for article in articles:
if article.title(underscore=True, with_section=False ) not in \
self.categorized_articles:
links.append( article.title(as_link=True, textlink=True) )
return links
@classmethod
def get_categorized_articles( cls ):
"""