Xqt has uploaded a new change for review.
https://gerrit.wikimedia.org/r/281661
Change subject: [bugfix] Improvements for site.allpages()
......................................................................
[bugfix] Improvements for site.allpages()
- assert test for start parameter to get the right type.
Previous implementation failed due to wrong type of start parameter
- doc strings added
Change-Id: Ibb1a161e05e0db95811fdf8f76d3d83cd9dce8cf
---
M pywikibot/site.py
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/61/281661/1
diff --git a/pywikibot/site.py b/pywikibot/site.py
index c421fbf..70cd652 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3905,7 +3905,9 @@
"""Iterate pages in a single namespace.
@param start: Start at this title (page need not exist).
+ @type start: str
@param prefix: Only yield pages starting with this string.
+ @type prefix: str
@param namespace: Iterate pages from this (single) namespace
@type namespace: int or Namespace.
@param filterredir: if True, only yield redirects; if False (and not
@@ -3943,6 +3945,7 @@
warn('The value "{0!r}" for "filterredir" is deprecated; use '
'{1} instead.'.format(old, filterredir), DeprecationWarning,
3)
+ assert isinstance(start, basestring), 'start parameter must be str
type'
apgen = self._generator(api.PageGenerator, type_arg="allpages",
namespaces=namespace,
gapfrom=start, total=total,
--
To view, visit https://gerrit.wikimedia.org/r/281661
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb1a161e05e0db95811fdf8f76d3d83cd9dce8cf
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits