jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/344314 )
Change subject: [L10N] use page_from_repository() method for fixing_redirects.py ......................................................................
[L10N] use page_from_repository() method for fixing_redirects.py
Change-Id: I5161e22d1381072cc2299e331944512fc0114f93 --- M scripts/fixing_redirects.py 1 file changed, 4 insertions(+), 10 deletions(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/fixing_redirects.py b/scripts/fixing_redirects.py index 359082d..d65b9fd 100755 --- a/scripts/fixing_redirects.py +++ b/scripts/fixing_redirects.py @@ -13,7 +13,7 @@
""" # -# (C) Pywikibot team, 2004-2016 +# (C) Pywikibot team, 2004-2017 # # Distributed under the terms of the MIT license. # @@ -198,15 +198,9 @@ return
if featured: - repo = mysite.data_repository() - if repo: - dp = pywikibot.ItemPage(repo, featured_articles) - try: - ref = pywikibot.Category(mysite, dp.getSitelink(mysite)) - except pywikibot.NoPage: - pass - else: - gen = ref.articles(namespaces=0, content=True) + ref = mysite.page_from_repository(featured_articles) + if ref is not None: + gen = ref.articles(namespaces=0, content=True) if not gen: suggest_help( unknown_parameters=['-featured'],
pywikibot-commits@lists.wikimedia.org