jenkins-bot has submitted this change and it was merged.

Change subject: site.py: prefixindex should also return non-redirects by default
......................................................................


site.py: prefixindex should also return non-redirects by default

The prefixindex function was only returning redirects by default which
was unintuitive.

To fix that, calculate the appropriate value for filterredir before passing
 it to allpages() and try to keep the new implementation backward compatible
 with the original one.

See the following commits for the original implementation:
- df1292d96469bae6d06c919d5c1260025b3848c2
- 187f51bb7d9b4a5083e436d0c7027ea441da4eed

Change-Id: Ib486292f2596612e7709ab44a563a207b8e2b58b
---
M pywikibot/site.py
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  John Vandenberg: Looks good to me, but someone else must approve
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/site.py b/pywikibot/site.py
index aac59f5..e366f5b 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3966,8 +3966,14 @@
 
         Use allpages() with the prefix= parameter instead of this method.
         """
+        if not includeredirects:
+            filterredir = False
+        elif includeredirects == 'only':
+            filterredir = True
+        else:
+            filterredir = None
         return self.allpages(prefix=prefix, namespace=namespace,
-                             filterredir=includeredirects)
+                             filterredir=filterredir)
 
     @deprecated_args(step=None)
     def alllinks(self, start="!", prefix="", namespace=0, unique=False,

-- 
To view, visit https://gerrit.wikimedia.org/r/274809
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib486292f2596612e7709ab44a563a207b8e2b58b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.w...@gmail.com>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: XZise <commodorefabia...@gmx.de>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
Pywikibot-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to