jenkins-bot has submitted this change and it was merged.
Change subject: [LINT] import needed time module, ignore editor's result (+pep8) ......................................................................
[LINT] import needed time module, ignore editor's result (+pep8)
- time.sleep() needs its module to be imported first - editarticle.Texeditor's result is not used. So we may call it as a procedure and not as a function - pep8 changes E501
Change-Id: Iab6d4a035a964189f3ad162bd47f926229911004 --- M scripts/blockpageschecker.py 1 file changed, 18 insertions(+), 9 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/blockpageschecker.py b/scripts/blockpageschecker.py index d6f813f..1a55a99 100755 --- a/scripts/blockpageschecker.py +++ b/scripts/blockpageschecker.py @@ -64,6 +64,7 @@ __version__ = '$Id$' #
+import time import re import webbrowser import pywikibot @@ -85,8 +86,10 @@ 'en': None, 'it': [r'{{(?:[Tt]emplate:|)[Aa]vvisobloccoparziale(?:|[ _]scad|.*?||.*?)}}', r'{{(?:[Tt]emplate:|)[Aa]bp(?:|[ _]scad|(?:.*?))}}'], - 'fr': [r'{{(?:[Tt]emplate:|' + u'[Mm]odèle:' + r'|)[Ss]emi[- ]?protection(|[^}]*)}}'], - 'ja': [r'(?<!<nowiki>){{(?:[Tt]emplate:|)' + u'半保護' + r'(?:[Ss]|)(?:|.+|)}}(?!</nowiki>)\s*(?:\r\n|)*'], + 'fr': [r'{{(?:[Tt]emplate:|' + u'[Mm]odèle:' + + r'|)[Ss]emi[- ]?protection(|[^}]*)}}'], + 'ja': [r'(?<!<nowiki>){{(?:[Tt]emplate:|)' + + u'半保護' + r'(?:[Ss]|)(?:|.+|)}}(?!</nowiki>)\s*(?:\r\n|)*'], } # Regex to get the total-protection template templateTotalProtection = { @@ -94,23 +97,28 @@ 'it': [r'{{(?:[Tt]emplate:|)[Aa]vvisoblocco(?:|[ _]scad|(?:.*?)|minaccia|cancellata)}}', r'{{(?:[Tt]emplate:|)(?:[Cc][Tt]|[Cc]anc fatte|[Cc][Ee])}}', r'<div class="toccolours[ _]itwiki[ _]template[ _]avviso">(?:\s|\n)*?[Qq]uesta pagina'], - 'fr': [r'{{(?:[Tt]emplate:|' + u'[Mm]odèle:' + r'|)[Pp]rotection(|[^}]*)}}', - r'{{(?:[Tt]emplate:|' + u'[Mm]odèle:' + r'|)(?:[Pp]age|[Aa]rchive|' + u'[Mm]odèle) protégée' + r'?(|[^}]*)}}'], - 'ja': [r'(?<!<nowiki>){{(?:[Tt]emplate:|)' + u'保護(?:性急|)' + r'(?:[Ss]|)(?:|.+|)}}(?!</nowiki>)\s*(?:\r\n|)*'], + 'fr': [r'{{(?:[Tt]emplate:|' + u'[Mm]odèle:' + + r'|)[Pp]rotection(|[^}]*)}}', + r'{{(?:[Tt]emplate:|' + u'[Mm]odèle:' + r'|)(?:[Pp]age|[Aa]rchive|' + + u'[Mm]odèle) protégée' + r'?(|[^}]*)}}'], + 'ja': [r'(?<!<nowiki>){{(?:[Tt]emplate:|)' + u'保護(?:性急|)' + + r'(?:[Ss]|)(?:|.+|)}}(?!</nowiki>)\s*(?:\r\n|)*'], }
# Regex to get the semi-protection move template templateSemiMoveProtection = { 'en': None, 'it': [r'{{(?:[Tt]emplate:|)[Aa]vvisobloccospostamento(?:|[ _]scad|.*?||.*?)}}'], - 'ja': [r'(?<!<nowiki>){{(?:[Tt]emplate:|)' + u'移動半保護' + r'(?:[Ss]|)(?:|.+|)}}(?!</nowiki>)\s*(?:\r\n|)*'], + 'ja': [r'(?<!<nowiki>){{(?:[Tt]emplate:|)' + u'移動半保護' + + r'(?:[Ss]|)(?:|.+|)}}(?!</nowiki>)\s*(?:\r\n|)*'], }
# Regex to get the total-protection move template templateTotalMoveProtection = { 'en': None, 'it': [r'{{(?:[Tt]emplate:|)[Aa]vvisobloccospostamento(?:|[ _]scad|.*?||.*?)}}'], - 'ja': [r'(?<!<nowiki>){{(?:[Tt]emplate:|)' + u'移動保護' + r'(?:[Ss]|)(?:|.+|)}}(?!</nowiki>)\s*(?:\r\n|)*'], + 'ja': [r'(?<!<nowiki>){{(?:[Tt]emplate:|)' + u'移動保護' + + r'(?:[Ss]|)(?:|.+|)}}(?!</nowiki>)\s*(?:\r\n|)*'], }
# If you use only one template for all the type of protection, put it here. @@ -199,7 +207,7 @@ elif quest == 'g': from pywikibot import editor as editarticle editor = editarticle.TextEditor() - text = editor.edit(page.get()) + editor.edit(page.get())
def main(): @@ -290,7 +298,8 @@ # PreloadingGenerator cannot set correctly page.editRestriction # (see bug #1949476 ) if not page.canBeEdited(): - pywikibot.output("%s is sysop-protected : this account can't edit it! Skipping..." % pagename) + pywikibot.output("%s is sysop-protected : this account can't edit " + "it! Skipping..." % pagename) continue """ if 'edit' in restrictions.keys():
pywikibot-commits@lists.wikimedia.org