jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/339954 )
Change subject: proofreadpage.py: purge is skipped if redlinks are present
......................................................................
proofreadpage.py: purge is skipped if redlinks are present
Purge action is skipped when redlinks are present in the page list.
Postpone the search of redlinks after the purge action check.
Change-Id: I42d72fc721c90fca362e6d2b46f17488ef6782f4
---
M pywikibot/proofreadpage.py
1 file changed, 6 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py
index a3dd4d4..84460db 100644
--- a/pywikibot/proofreadpage.py
+++ b/pywikibot/proofreadpage.py
@@ -544,14 +544,16 @@
self._parsed_text = self._get_parsed_page()
self._soup = BeautifulSoup(self._parsed_text, 'html.parser')
- attrs = {'class': re.compile('prp-pagequality|new')}
+ # Do not search for "new" here, to avoid to skip purging if links
+ # to non-existing pages are present.
+ attrs = {'class': re.compile('prp-pagequality')}
# Search for attribute "prp-pagequality" in tags:
# Existing pages:
# <a href="/wiki/Page:xxx.djvu/n"
# title="Page:xxx.djvu/n">m
# class="quality1 prp-pagequality-1"
- # </a> or
+ # </a>
# Non-existing pages:
# <a
href="/w/index.php?title=xxx&action=edit&redlink=1"
# class="new"
@@ -570,6 +572,8 @@
'class="new" in: %s.'
% self)
+ # Search for attribute "prp-pagequality" or "new" in tags:
+ attrs = {'class': re.compile('prp-pagequality|new')}
page_cnt = 0
for a_tag in self._soup.find_all('a', attrs=attrs):
label = a_tag.text.lstrip('0') # Label is not converted to int.
--
To view, visit
https://gerrit.wikimedia.org/r/339954
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I42d72fc721c90fca362e6d2b46f17488ef6782f4
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>