jenkins-bot submitted this change.

View Change

Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
[cleanup] Show a FutureWarning for code deprecated for 5 years

Change-Id: I120d98e8f8560295b183aa0c2fb3fb952ffa54e1
---
M pywikibot/page/__init__.py
M pywikibot/pagegenerators.py
M pywikibot/site/__init__.py
M pywikibot/site/_siteinfo.py
4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 36ed562..cc41edc 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -2420,7 +2420,7 @@
self._imagePageHtml = http.request(self.site, path)
return self._imagePageHtml

- @deprecated('get_file_url', since='20160609')
+ @deprecated('get_file_url', since='20160609', future_warning=True)
def fileUrl(self): # pragma: no cover
"""Return the URL for the file described on this page."""
return self.latest_file_info.url
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index e67897a..9c3b365 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -2679,13 +2679,13 @@
self.parser = dump.parse()

@property
- @deprecated('self.start', since='20160414')
+ @deprecated('self.start', since='20160414', future_warning=True)
def xmlStart(self):
"""Deprecated xmlStart instance variable."""
return self.start

@xmlStart.setter
- @deprecated('self.start', since='20160414')
+ @deprecated('self.start', since='20160414', future_warning=True)
def xmlStart(self, value):
self.start = value

@@ -2931,11 +2931,14 @@
since='20170314')
# Deprecated old names available for compatibility with compat.
ImageGenerator = redirect_func(
- PageClassGenerator, old_name='ImageGenerator', since='20161017')
+ PageClassGenerator, old_name='ImageGenerator', since='20161017',
+ future_warning=True)
FileGenerator = redirect_func(
- PageClassGenerator, old_name='FileGenerator', since='20161017')
+ PageClassGenerator, old_name='FileGenerator', since='20161017',
+ future_warning=True)
CategoryGenerator = redirect_func(
- PageClassGenerator, old_name='CategoryGenerator', since='20161017')
+ PageClassGenerator, old_name='CategoryGenerator', since='20161017',
+ future_warning=True)
wrapper = ModuleDeprecationWrapper(__name__)
wrapper._add_deprecated_attr('YahooSearchPageGenerator', replacement_name='',
since='20181128')
diff --git a/pywikibot/site/__init__.py b/pywikibot/site/__init__.py
index b865187..5ea559b 100644
--- a/pywikibot/site/__init__.py
+++ b/pywikibot/site/__init__.py
@@ -965,7 +965,7 @@
return self.data_repository() is not None

@property
- @deprecated('has_data_repository', since='20160405')
+ @deprecated('has_data_repository', since='20160405', future_warning=True)
def has_transcluded_data(self):
"""Return True if site has a shared data repository like Wikidata."""
return self.has_data_repository
@@ -2990,6 +2990,7 @@
if where == 'titles':
issue_deprecation_warning("where='titles'",
"where='title'",
+ warning_class=FutureWarning,
since='20160224')
where = 'title'
if not namespaces and namespaces != 0:
@@ -4205,7 +4206,7 @@
return True

@need_right('editmywatchlist')
- @deprecated('Site().watch', since='20160102')
+ @deprecated('Site().watch', since='20160102', future_warning=True)
def watchpage(self, page, unwatch=False) -> bool:
"""
Add or remove page from watchlist.
diff --git a/pywikibot/site/_siteinfo.py b/pywikibot/site/_siteinfo.py
index 067acaf..0dad9a0 100644
--- a/pywikibot/site/_siteinfo.py
+++ b/pywikibot/site/_siteinfo.py
@@ -356,7 +356,8 @@
def __call__(self, key='general', force=False, dump=False):
"""DEPRECATED: Return the entry for key or dump the complete cache."""
issue_deprecation_warning(
- 'Calling siteinfo', 'itself as a dictionary', since='20161221'
+ 'Calling siteinfo', 'itself as a dictionary', since='20161221',
+ warning_class=FutureWarning
)
result = self.get(key, expiry=force)
if not dump:

To view, visit change 651562. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I120d98e8f8560295b183aa0c2fb3fb952ffa54e1
Gerrit-Change-Number: 651562
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Mpaa <mpaa.wiki@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged