jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/637876 )
Change subject: [cleanup] Remove deprecated UserBlocked exception and Page.contributingUsers() ......................................................................
[cleanup] Remove deprecated UserBlocked exception and Page.contributingUsers()
UserBlocked exception and Page.contributingUsers() are deprecated for more than 5 years and their removal was announced in Pywikibot 4.3.
Change-Id: Ie797b335e91b4e5d3e6d328486e0fc6ff38c5c2a --- M pywikibot/__init__.py M pywikibot/exceptions.py M pywikibot/page/__init__.py M scripts/category.py 4 files changed, 18 insertions(+), 44 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index e9f40c7..f8216e2 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -36,18 +36,16 @@ from pywikibot.data.api import UploadWarning from pywikibot.diff import PatchManager from pywikibot.exceptions import ( - Error, InvalidTitle, BadTitle, NoPage, NoMoveTarget, SectionError, - SiteDefinitionError, NoSuchSite, UnknownSite, UnknownFamily, - UnknownExtension, - NoUsername, UserBlocked, - PageRelatedError, UnsupportedPage, IsRedirectPage, IsNotRedirectPage, - PageSaveRelatedError, PageNotSaved, OtherPageSaveError, - LockedPage, CascadeLockedPage, LockedNoPage, NoCreateError, - EditConflict, PageDeletedConflict, PageCreatedConflict, - ServerError, FatalServerError, Server414Error, Server504Error, - CaptchaError, SpamblacklistError, TitleblacklistError, - CircularRedirect, InterwikiRedirectPage, WikiBaseError, NoWikibaseEntity, - CoordinateGlobeUnknownException, + BadTitle, CaptchaError, CascadeLockedPage, CircularRedirect, + CoordinateGlobeUnknownException, EditConflict, Error, FatalServerError, + InterwikiRedirectPage, InvalidTitle, IsNotRedirectPage, IsRedirectPage, + LockedNoPage, LockedPage, NoCreateError, NoMoveTarget, NoPage, NoSuchSite, + NoUsername, NoWikibaseEntity, OtherPageSaveError, PageCreatedConflict, + PageDeletedConflict, PageNotSaved, PageRelatedError, PageSaveRelatedError, + SectionError, Server414Error, Server504Error, ServerError, + SiteDefinitionError, SpamblacklistError, TitleblacklistError, + UnknownExtension, UnknownFamily, UnknownSite, UnsupportedPage, + WikiBaseError, ) from pywikibot.family import Family from pywikibot.i18n import translate @@ -89,15 +87,14 @@ 'NoSuchSite', 'NoUsername', 'NoWikibaseEntity', 'OtherPageSaveError', 'output', 'Page', 'PageCreatedConflict', 'PageDeletedConflict', 'PageNotSaved', 'PageRelatedError', 'PageSaveRelatedError', 'PropertyPage', - 'QuitKeyboardInterrupt', 'SectionError', - 'ServerError', 'FatalServerError', 'Server414Error', 'Server504Error', - 'showDiff', 'show_help', 'showHelp', 'Site', 'SiteDefinitionError', - 'SiteLink', 'SpamblacklistError', 'stdout', 'Timestamp', - 'TitleblacklistError', 'translate', 'ui', 'unicode2html', + 'QuitKeyboardInterrupt', 'SectionError', 'Server414Error', + 'Server504Error', 'ServerError', 'showDiff', 'show_help', 'showHelp', + 'Site', 'SiteDefinitionError', 'SiteLink', 'SpamblacklistError', 'stdout', + 'Timestamp', 'TitleblacklistError', 'translate', 'ui', 'unicode2html', 'UnknownExtension', 'UnknownFamily', 'UnknownSite', 'UnsupportedPage', - 'UploadWarning', 'url2unicode', 'User', 'UserBlocked', 'warning', - 'WbGeoShape', 'WbMonolingualText', 'WbQuantity', 'WbTabularData', 'WbTime', - 'WbUnknown', 'WikiBaseError', 'WikidataBot', + 'UploadWarning', 'url2unicode', 'User', 'warning', 'WbGeoShape', + 'WbMonolingualText', 'WbQuantity', 'WbTabularData', 'WbTime', 'WbUnknown', + 'WikiBaseError', 'WikidataBot', )
diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py index 662a1dd..709adfe 100644 --- a/pywikibot/exceptions.py +++ b/pywikibot/exceptions.py @@ -5,7 +5,6 @@ Error: Base class, all exceptions should the subclass of this class.
- NoUsername: Username is not in user-config.py, or it is invalid. - - UserBlocked: Username or IP has been blocked - AutoblockUser: requested action on a virtual autoblock user not valid - UserRightsError: insufficient rights for requested action - BadTitle: Server responded with BadTitle @@ -563,13 +562,3 @@ """Request failed with a maxlag timeout error."""
pass - -# DEPRECATED exceptions which will be removed ########################## - - -# UserBlocked exceptions is not used by the framework. -class UserBlocked(Error): - - """DEPRECATED. Your username or IP has been blocked.""" - - pass diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py index 35b04b6..8cd9b52 100644 --- a/pywikibot/page/__init__.py +++ b/pywikibot/page/__init__.py @@ -1728,18 +1728,6 @@ self.revisions(total=total, starttime=starttime, endtime=endtime))
- @deprecated('contributors().keys()', since='20150206', future_warning=True) - def contributingUsers(self, - total: Optional[int] = None): # pragma: no cover - """ - Return a set of usernames (or IPs) of users who edited this page. - - @param total: iterate no more than this number of revisions in total - - @rtype: dict_keys - """ - return self.contributors(total=total).keys() - def revision_count(self, contributors=None) -> int: """Determine number of edits from contributors.
diff --git a/scripts/category.py b/scripts/category.py index 46f1a67..67d9c68 100755 --- a/scripts/category.py +++ b/scripts/category.py @@ -792,7 +792,7 @@ pywikibot.output('Moving text from {} to {}.'.format( self.oldcat.title(), self.newcat.title())) comma = self.site.mediawiki_message('comma-separator') - authors = comma.join(self.oldcat.contributingUsers()) + authors = comma.join(self.oldcat.contributors().keys()) template_vars = {'oldcat': self.oldcat.title(), 'authors': authors} summary = i18n.twtranslate(self.site, 'category-renamed', template_vars)
pywikibot-commits@lists.wikimedia.org