|
@ -633,7 +633,9 @@ class RedFamWorker( RedFam ): |
|
|
# with wrong month abreviations in strptime |
|
|
# with wrong month abreviations in strptime |
|
|
locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8') |
|
|
locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8') |
|
|
|
|
|
|
|
|
def article_generator(self, filter_existing=None, filter_redirects=None ): |
|
|
def article_generator(self, filter_existing=None, filter_redirects=None, |
|
|
|
|
|
exclude_article_status=[], |
|
|
|
|
|
onlyinclude_article_status=[] ): |
|
|
""" |
|
|
""" |
|
|
Yields pywikibot pageobjects for articles belonging to this redfams |
|
|
Yields pywikibot pageobjects for articles belonging to this redfams |
|
|
in a generator |
|
|
in a generator |
|
@ -647,11 +649,22 @@ class RedFamWorker( RedFam ): |
|
|
set to False to get only redirectpages, |
|
|
set to False to get only redirectpages, |
|
|
unset/None results in not filtering |
|
|
unset/None results in not filtering |
|
|
@type filter_redirects bool/None |
|
|
@type filter_redirects bool/None |
|
|
|
|
|
|
|
|
""" |
|
|
""" |
|
|
# Iterate over articles in redfam |
|
|
# Iterate over articles in redfam |
|
|
for article in self._articlesList: |
|
|
for article in self._articlesList: |
|
|
page = pywikibot.Page(pywikibot.Link(article), self.site) |
|
|
page = pywikibot.Page(pywikibot.Link(article), self.site) |
|
|
|
|
|
|
|
|
|
|
|
# Exclude by article status |
|
|
|
|
|
for status in exclude_article_status: |
|
|
|
|
|
if self.article_has_status( status, title=article ): |
|
|
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
# Only include by article status |
|
|
|
|
|
for status in onlyinclude_article_status: |
|
|
|
|
|
if not self.article_has_status( status, title=article ): |
|
|
|
|
|
continue |
|
|
|
|
|
|
|
|
# Filter non existing Pages if requested with filter_existing=True |
|
|
# Filter non existing Pages if requested with filter_existing=True |
|
|
if filter_existing and not page.exists(): |
|
|
if filter_existing and not page.exists(): |
|
|
continue |
|
|
continue |
|
|