jenkins-bot has submitted this change and it was merged.
Change subject: replace site.lang with site.code, code improvements ......................................................................
replace site.lang with site.code, code improvements
- use site.code which is needed here - use page.title(asUrl=True) instead of deprecated method - use site object from page instead of global one for showQuest - use site.protocol() instead of hardcoded 'http' - use nice_get_address() insead of nicepath() + title()
Change-Id: Iabc838e322c6deb6936d40b0ca04172a362b5844 --- M scripts/blockpageschecker.py 1 file changed, 8 insertions(+), 6 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/blockpageschecker.py b/scripts/blockpageschecker.py index 5962d03..62b1d26 100755 --- a/scripts/blockpageschecker.py +++ b/scripts/blockpageschecker.py @@ -195,19 +195,21 @@ return ('editable', r'\A\n')
-def showQuest(site, page): +def showQuest(page): quest = pywikibot.inputChoice(u'Do you want to open the page?', ['with browser', 'with gui', 'no'], ['b', 'g', 'n'], 'n') - pathWiki = site.family.nicepath(site.lang) - url = 'http://%s%s%s?&redirect=no' % (pywikibot.Site().hostname(), - pathWiki, page.urlname()) + site = page.site + url = '%s://%s%s?redirect=no' % (site.protocol(), + site.hostname(), + site.nice_get_address( + page.title(asUrl=True))) if quest == 'b': webbrowser.open(url) elif quest == 'g': from pywikibot import editor as editarticle editor = editarticle.TextEditor() - editor.edit(page.get()) + editor.edit(page.text)
def main(): @@ -295,7 +297,7 @@ except pywikibot.IsRedirectPage: pywikibot.output("%s is a redirect! Skipping..." % pagename) if show: - showQuest(site, page) + showQuest(page) continue """ # This check does not work :
pywikibot-commits@lists.wikimedia.org