jenkins-bot has submitted this change and it was merged.
Change subject: pagegenerators.py: explain LinksearchPageGenerator params
......................................................................
pagegenerators.py: explain LinksearchPageGenerator params
Improve docstring of LinksearchPageGenerator() to explain that protocol
must not be part of the input parameter.
Rename parameter link->url:
- same name used by the corresponding site.exturlusage() function
- url is the name used in API documentation
- link is ambigous as in can be intended as wikilink
Bug: T112852
Change-Id: I13515ea412711dfaf02d89a5e11234c8859df8cf
---
M pywikibot/pagegenerators.py
M pywikibot/site.py
2 files changed, 11 insertions(+), 7 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index ecffb9a..9198dca 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -2054,13 +2054,17 @@
yield page
-@deprecated_args(euprotocol='protocol')
-def LinksearchPageGenerator(link, namespaces=None, step=None, total=None,
+@deprecated_args(link='url', euprotocol='protocol')
+def LinksearchPageGenerator(url, namespaces=None, step=None, total=None,
site=None, protocol='http'):
- """Yield all pages that include a specified link.
+ """Yield all pages that link to a certain URL, like
Special:Linksearch.
- Obtains data from [[Special:Linksearch]].
-
+ @param url: The URL to search for (without the protocol prefix);
+ this may include a '*' as a wildcard, only at the start of the
+ hostname
+ @type url: str
+ @param namespaces: list of namespace numbers to fetch contribs from
+ @type namespaces: list of int
@param step: Maximum number of pages to retrieve per API query
@type step: int
@param total: Maxmum number of pages to retrieve in total
@@ -2070,7 +2074,7 @@
"""
if site is None:
site = pywikibot.Site()
- return site.exturlusage(link, namespaces=namespaces, protocol=protocol,
+ return site.exturlusage(url, namespaces=namespaces, protocol=protocol,
step=step, total=total, content=False)
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 54c40d9..384f333 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -4122,7 +4122,7 @@
"""Iterate Pages that contain links to the given URL.
@param url: The URL to search for (without the protocol prefix);
- this many include a '*' as a wildcard, only at the start of the
+ this may include a '*' as a wildcard, only at the start of the
hostname
@param protocol: The protocol prefix (default: "http")
--
To view, visit
https://gerrit.wikimedia.org/r/250183
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I13515ea412711dfaf02d89a5e11234c8859df8cf
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: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>