jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/721273 )
Change subject: [cleanup] Remove deleting/undeleting APISite methods ......................................................................
[cleanup] Remove deleting/undeleting APISite methods
Remove deletepage, deleteoldimage, undelete_page, undelete_file_versions in favour of delete and undelete methods. All are deprecated since 6.0.1.
Change-Id: I966ec6d3b97340eb37b78ceed48eb0c1dfac6dff --- M pywikibot/site/_apisite.py 1 file changed, 0 insertions(+), 62 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py index 17ac882..70fc2ad 100644 --- a/pywikibot/site/_apisite.py +++ b/pywikibot/site/_apisite.py @@ -2120,38 +2120,6 @@ finally: self.unlock_page(page)
- @deprecate_arg('summary', 'reason') - @deprecated('delete()', since='20210330') - def deletepage(self, page, reason: str): - """Delete page from the wiki. Requires appropriate privilege level. - - :see: https://www.mediawiki.org/wiki/API:Delete - Page to be deleted can be given either as Page object or as pageid. - - :param page: Page to be deleted or its pageid. - :type page: :py:obj:`pywikibot.page.BasePage` or, for pageid, - int or str - :param reason: Deletion reason. - :raises TypeError, ValueError: page has wrong type/value. - """ - self.delete(page, reason) - - @deprecated('delete() with oldimage keyword parameter', since='20210330') - def deleteoldimage(self, page, oldimage: str, reason: str): - """Delete a specific version of a file. Requires appropriate privileges. - - :see: https://www.mediawiki.org/wiki/API:Delete - The oldimage identifier for the specific version of the image must be - provided. - - :param page: Page to be deleted or its pageid - :type page: FilePage or, in case of pageid, int or str - :param oldimage: oldimageid of the file version to be deleted. - :param reason: Deletion reason. - :raises TypeError, ValueError: page has wrong type/value. - """ - self.delete(page, reason, oldimage=oldimage) - @need_right('undelete') def undelete(self, page, reason: str, *, revisions=None, fileids=None): """Undelete page from the wiki. Requires appropriate privilege level. @@ -2204,36 +2172,6 @@ finally: self.unlock_page(page)
- @deprecate_arg('summary', 'reason') - @deprecated('undelete()', since='20210330') - def undelete_page(self, page, reason: str, revisions=None): - """DEPRECATED. Undelete page from the wiki. - - :see: https://www.mediawiki.org/wiki/API:Undelete - - :param page: Page to be deleted. - :type page: pywikibot.BasePage - :param revisions: List of timestamps to restore. - If None, restores all revisions. - :type revisions: list - :param reason: Undeletion reason. - """ - self.undelete(page, reason, revisions=revisions) - - @deprecated('undelete() with fileids parameter', since='20210330') - def undelete_file_versions(self, page, reason: str, fileids=None): - """DEPRECATED. Undelete page from the wiki. - - :see: https://www.mediawiki.org/wiki/API:Undelete - - :param page: Page to be deleted. - :type page: pywikibot.BasePage - :param reason: Undeletion reason. - :param fileids: List of fileids to restore. - :type fileids: list - """ - self.undelete(page, reason, fileids=fileids) - _protect_errors = { 'noapiwrite': 'API editing not enabled on {site} wiki', 'writeapidenied': 'User {user} not allowed to edit through the API',
pywikibot-commits@lists.wikimedia.org