jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1041050?usp=email )

Change subject: [bugfix] fix keyword argument in BaseSite.undelete when calling 
site.undelete
......................................................................

[bugfix] fix keyword argument in BaseSite.undelete when calling site.undelete

Also update docstrings

Bug: T367037
Change-Id: I46a460dbf3cdc503530fc217b77f27707dd28a84
---
M pywikibot/page/_basepage.py
1 file changed, 27 insertions(+), 16 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/pywikibot/page/_basepage.py b/pywikibot/page/_basepage.py
index 4883639..51d8438 100644
--- a/pywikibot/page/_basepage.py
+++ b/pywikibot/page/_basepage.py
@@ -2028,8 +2028,7 @@
         return self._has_deleted_revisions

     def loadDeletedRevisions(self, total: int | None = None, **kwargs):
-        """
-        Retrieve deleted revisions for this Page.
+        """Retrieve deleted revisions for this Page.

         Stores all revisions' timestamps, dates, editors and comments in
         self._deletedRevs attribute.
@@ -2074,8 +2073,11 @@
         return []

     def markDeletedRevision(self, timestamp, undelete: bool = True):
-        """
-        Mark the revision identified by timestamp for undeletion.
+        """Mark the revision identified by timestamp for undeletion.
+
+        .. seealso::
+           - :meth:`undelete`
+           - :meth:`loadDeletedRevisions`

         :param undelete: if False, mark the revision to remain deleted.
         """
@@ -2087,24 +2089,33 @@
         self._deletedRevs[timestamp]['marked'] = undelete

     def undelete(self, reason: str | None = None) -> None:
-        """
-        Undelete revisions based on the markers set by previous calls.
+        """Undelete revisions based on the markers set by previous calls.

-        If no calls have been made since loadDeletedRevisions(), everything
-        will be restored.
+        If no calls have been made since :meth:`loadDeletedRevisions`,
+        everything will be restored.

-        Simplest case::
+        Simplest case:
+
+        .. code-block:: python

             Page(...).undelete('This will restore all revisions')

-        More complex::
+        More complex:

-            pg = Page(...)
-            revs = pg.loadDeletedRevisions()
+        .. code-block:: Python
+
+            page = Page(...)
+            revs = page.loadDeletedRevisions()
             for rev in revs:
-                if ... #decide whether to undelete a revision
-                    pg.markDeletedRevision(rev) #mark for undeletion
-            pg.undelete('This will restore only selected revisions.')
+                if ...  # decide whether to undelete a revision
+                    page.markDeletedRevision(rev)  # mark for undeletion
+            page.undelete('This will restore only selected revisions.')
+
+        .. seealso::
+           - :meth:`loadDeletedRevisions`
+           - :meth:`markDeletedRevision`
+           - :meth:`site.APISite.undelete
+             <pywikibot.site._apisite.APISite.undelete>`

         :param reason: Reason for the action.
         """
@@ -2119,7 +2130,7 @@
             pywikibot.info(f'Undeleting {self.title(as_link=True)}.')
             reason = pywikibot.input(
                 'Please enter a reason for the undeletion:')
-        self.site.undelete(self, reason, revision=undelete_revs)
+        self.site.undelete(self, reason, revisions=undelete_revs)

     def protect(self,
                 reason: str | None = None,

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

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I46a460dbf3cdc503530fc217b77f27707dd28a84
Gerrit-Change-Number: 1041050
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to