jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/775948 )

Change subject: [IMPR] enable all parameters of APISite.imageusage() with 
FilePage.usingPages()
......................................................................

[IMPR] enable all parameters of APISite.imageusage() with FilePage.usingPages()

Change-Id: Ifda1a4ba119a9f7904f30c48468359dda4e2a288
---
M pywikibot/page/_pages.py
M pywikibot/site/_generators.py
2 files changed, 19 insertions(+), 9 deletions(-)

Approvals:
  Matěj Suchánek: Looks good to me, but someone else must approve
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/page/_pages.py b/pywikibot/page/_pages.py
index f095424..3eea4ad 100644
--- a/pywikibot/page/_pages.py
+++ b/pywikibot/page/_pages.py
@@ -2473,14 +2473,19 @@
                 '| {{int:filehist-dimensions}} || {{int:filehist-comment}}\n'
                 '|-\n%s\n|}\n' % '\n|-\n'.join(lines))

-    def usingPages(self, total: Optional[int] = None, content: bool = False):
+    def usingPages(self, **kwargs):
         """Yield Pages on which the file is displayed.

-        :param total: iterate no more than this number of pages in total
-        :param content: if True, load the current content of each iterated page
-            (default False)
+        For parameters refer
+        :meth:`APISite.imageusage()
+        <pywikibot.site._generators.GeneratorsMixin.imageusage>`
+
+        .. versionchanged:: 7.2
+           all parameters from :meth:`APISite.imageusage()
+           <pywikibot.site._generators.GeneratorsMixin.imageusage>`
+           are available.
         """
-        return self.site.imageusage(self, total=total, content=content)
+        return self.site.imageusage(self, **kwargs)

     @property
     def file_is_used(self) -> bool:
diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py
index bf0b494..d6ecd73 100644
--- a/pywikibot/site/_generators.py
+++ b/pywikibot/site/_generators.py
@@ -1186,21 +1186,26 @@
                                namespaces=namespaces,
                                total=total, g_content=content)

-    def imageusage(self, image, namespaces=None, filterredir=None,
-                   total=None, content: bool = False):
+    def imageusage(self, image: 'pywikibot.FilePage', *,
+                   namespaces=None,
+                   filterredir: Optional[bool] = None,
+                   total: Optional[int] = None,
+                   content: bool = False):
         """Iterate Pages that contain links to the given FilePage.

-        :see: https://www.mediawiki.org/wiki/API:Imageusage
+        .. seealso:: https://www.mediawiki.org/wiki/API:Imageusage
+        .. versionchanged:: 7.2
+           all parameters except `image` are keyword only.

         :param image: the image to search for (FilePage need not exist on
             the wiki)
-        :type image: pywikibot.FilePage
         :param namespaces: If present, only iterate pages in these namespaces
         :type namespaces: iterable of str or Namespace key,
             or a single instance of those types. May be a '|' separated
             list of namespace identifiers.
         :param filterredir: if True, only yield redirects; if False (and not
             None), only yield non-redirects (default: yield both)
+        :param total: iterate no more than this number of pages in total
         :param content: if True, load the current content of each iterated page
             (default False)
         :raises KeyError: a namespace identifier was not resolved

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/775948
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ifda1a4ba119a9f7904f30c48468359dda4e2a288
Gerrit-Change-Number: 775948
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to