jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/585904 )
Change subject: [cleanup] Desupport old deprecated methods ......................................................................
[cleanup] Desupport old deprecated methods
Desupport methods which are deprecated for 10 years or longer that they can be removed shortly.
Bug: T106121 Change-Id: Ic1f9f84b72f6f207a287c60a587a839ef8a2b086 --- M pywikibot/page/__init__.py M pywikibot/site/__init__.py M pywikibot/tools/djvu.py 3 files changed, 28 insertions(+), 19 deletions(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py index a1a92b5..f90adf4 100644 --- a/pywikibot/page/__init__.py +++ b/pywikibot/page/__init__.py @@ -2286,28 +2286,32 @@
# ####### DEPRECATED METHODS ########
- @deprecated('Site.encoding()', since='20090307') + @deprecated('Site.encoding()', since='20090307', future_warning=True) def encoding(self): """DEPRECATED: use self.site.encoding instead.""" return self.site.encoding()
- @deprecated('Page.title(with_ns=False)', since='20090307') + @deprecated('Page.title(with_ns=False)', since='20090307', + future_warning=True) def titleWithoutNamespace(self, underscore=False): """DEPRECATED: use self.title(with_ns=False) instead.""" return self.title(underscore=underscore, with_ns=False, with_section=False)
- @deprecated('Page.title(as_filename=True)', since='20090307') + @deprecated('Page.title(as_filename=True)', since='20090307', + future_warning=True) def titleForFilename(self): """DEPRECATED: use self.title(as_filename=True) instead.""" return self.title(as_filename=True)
- @deprecated('Page.title(with_section=False)', since='20090307') + @deprecated('Page.title(with_section=False)', since='20090307', + future_warning=True) def sectionFreeTitle(self, underscore=False): """DEPRECATED: use self.title(with_section=False) instead.""" return self.title(underscore=underscore, with_section=False)
- @deprecated('Page.title(as_link=True)', since='20090307') + @deprecated('Page.title(as_link=True)', since='20090307', + future_warning=True) @deprecated_args( forceInterwiki='force_interwiki', noInterwiki='no_interwiki') def aslink( @@ -2317,7 +2321,8 @@ return self.title(as_link=True, force_interwiki=force_interwiki, allow_interwiki=not no_interwiki, textlink=textlink)
- @deprecated('Page.title(as_url=True)', since='20090307') + @deprecated('Page.title(as_url=True)', since='20090307', + future_warning=True) def urlname(self): """Return the Page title encoded for use in an URL.
@@ -3140,22 +3145,26 @@ yield cached_page
# ### DEPRECATED METHODS #### - @deprecated('list(Category.subcategories(...))', since='20090307') + @deprecated('list(Category.subcategories(...))', since='20090307', + future_warning=True) def subcategoriesList(self, recurse=False): """DEPRECATED: Equivalent to list(self.subcategories(...)).""" return sorted(set(self.subcategories(recurse)))
- @deprecated('list(Category.articles(...))', since='20090307') + @deprecated('list(Category.articles(...))', since='20090307', + future_warning=True) def articlesList(self, recurse=False): """DEPRECATED: equivalent to list(self.articles(...)).""" return sorted(set(self.articles(recurse)))
- @deprecated('Category.categories()', since='20090307') + @deprecated('Category.categories()', since='20090307', + future_warning=True) def supercategories(self): """DEPRECATED: equivalent to self.categories().""" return self.categories()
- @deprecated('list(Category.categories(...))', since='20090307') + @deprecated('list(Category.categories(...))', since='20090307', + future_warning=True) def supercategoriesList(self): """DEPRECATED: equivalent to list(self.categories(...)).""" return sorted(set(self.categories())) @@ -3266,7 +3275,7 @@ self._userprops['blockreason'] = r[0]['reason'] return self._userprops
- @deprecated('User.registration()', since='20100609') + @deprecated('User.registration()', since='20100609', future_warning=True) def registrationTime(self, force=False): """ DEPRECATED. Fetch registration date for this user. @@ -3526,7 +3535,7 @@ """ return next(iter(self.logevents(total=1)), None)
- @deprecated('contributions', since='20091130') + @deprecated('contributions', since='20091130', future_warning=True) @deprecate_arg('limit', 'total') # To be consistent with rest of framework def editedPages(self, total=500): """ diff --git a/pywikibot/site/__init__.py b/pywikibot/site/__init__.py index d99ad80..f7b8471 100644 --- a/pywikibot/site/__init__.py +++ b/pywikibot/site/__init__.py @@ -1108,7 +1108,7 @@ '{site.family.name}_family for {site}'.format(site=self)) return pywikibot.Category(pywikibot.Link(name, self))
- @deprecated('pywikibot.Link', since='20090307') + @deprecated('pywikibot.Link', since='20090307', future_warning=True) def linkto(self, title, othersite=None): """DEPRECATED. Return a wikilink to a page.
@@ -1236,7 +1236,7 @@
# deprecated methods for backwards-compatibility
- @deprecated('family attribute', since='20090307') + @deprecated('family attribute', since='20090307', future_warning=True) def fam(self): """Return Family object for this Site.""" return self.family @@ -1998,7 +1998,7 @@
return True
- @deprecated('Site.user()', since='20090307') + @deprecated('Site.user()', since='20090307', future_warning=True) @remove_last_args(['sysop']) def loggedInAs(self): """Return the current username if logged in, otherwise return None. @@ -4336,7 +4336,7 @@ apgen.request['gapdir'] = 'descending' return apgen
- @deprecated('Site.allpages()', since='20090307') + @deprecated('Site.allpages()', since='20090307', future_warning=True) def prefixindex(self, prefix, namespace=0, includeredirects=True): """Yield all pages with a given prefix. Deprecated.
@@ -4418,7 +4418,7 @@ acgen.request['gacdir'] = 'descending' return acgen
- @deprecated('Site.allcategories()', since='20090307') + @deprecated('Site.allcategories()', since='20090307', future_warning=True) def categories(self, number=10, repeat=False): """DEPRECATED.""" if repeat: @@ -6231,7 +6231,7 @@ return all('linkupdate' in page for page in result) return True
- @deprecated('Site().exturlusage', since='20090529') + @deprecated('Site().exturlusage', since='20090529', future_warning=True) def linksearch(self, siteurl, limit=None, euprotocol=None): """Backwards-compatible interface to exturlusage().""" return self.exturlusage(siteurl, total=limit, protocol=euprotocol) diff --git a/pywikibot/tools/djvu.py b/pywikibot/tools/djvu.py index 859127e..8f375ea 100644 --- a/pywikibot/tools/djvu.py +++ b/pywikibot/tools/djvu.py @@ -117,7 +117,7 @@ return _str
@property - @deprecated('DjVuFile.file', since='2010222') + @deprecated('DjVuFile.file', since='2010222', future_warning=True) def file_djvu(self): """Deprecated file_djvu instance variable.""" return self.file
pywikibot-commits@lists.wikimedia.org