jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/458508 )
Change subject: [IMPR] Simplify needcheck method
......................................................................
[IMPR] Simplify needcheck method
2nd step detached from Id7ca3461d for easier reviewing
Change-Id: I96f503d45a81d430fea1e202b3d8dcb66174e30c
---
M scripts/makecat.py
1 file changed, 4 insertions(+), 10 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/makecat.py b/scripts/makecat.py
index 82f8b5e..325fa4e 100755
--- a/scripts/makecat.py
+++ b/scripts/makecat.py
@@ -59,18 +59,12 @@
"""Bot tries to find new articles for a given
category."""
@staticmethod
- def needcheck(pl):
+ def needcheck(page):
"""Verify whether the current page may be
processed."""
global main_ns, checked, skipdates
- if main_ns:
- if pl.namespace() != 0:
- return False
- if pl in checked:
- return False
- if skipdates:
- if pl.autoFormat()[0] is not None:
- return False
- return True
+ return not (main_ns and page.namespace() != 0
+ or page in checked
+ or skipdates and page.autoFormat()[0] is not None)
def change_category(self, page, catlist):
"""Change the category of page."""
--
To view, visit
https://gerrit.wikimedia.org/r/458508
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I96f503d45a81d430fea1e202b3d8dcb66174e30c
Gerrit-Change-Number: 458508
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)