From 78eab5f0f834b00c39fe3cd683275e1c310261b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Michael=20O=2E=20Hegg=C3=B8?= <danmichaelo@gmail.com> Date: Mon, 22 Aug 2016 00:27:44 +0200 Subject: [PATCH] Remove one deprecated method, postpone another - Remove `Page.get_expanded()` - Postpone removal of `Page.edit()` since it's a more popular method. per #130 --- mwclient/page.py | 11 +---------- tests/test_page.py | 7 ------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/mwclient/page.py b/mwclient/page.py index dbba7d5..7d6d071 100644 --- a/mwclient/page.py +++ b/mwclient/page.py @@ -120,19 +120,10 @@ class Page(object): def get_token(self, type, force=False): return self.site.get_token(type, force, title=self.name) - def get_expanded(self): - """Deprecated. Use page.text(expandtemplates=True) instead""" - warnings.warn("page.get_expanded() was deprecated in mwclient 0.7.0 " - "and will be removed in 0.8.0, " - "use page.text(expandtemplates=True) instead.", - category=DeprecationWarning, stacklevel=2) - - return self.text(expandtemplates=True) - def edit(self, *args, **kwargs): """Deprecated. Use page.text() instead""" warnings.warn("page.edit() was deprecated in mwclient 0.7.0 " - "and will be removed in 0.8.0, please use page.text() instead.", + "and will be removed in 0.9.0, please use page.text() instead.", category=DeprecationWarning, stacklevel=2) return self.text(*args, **kwargs) diff --git a/tests/test_page.py b/tests/test_page.py index 5ff67c4..c2228ea 100644 --- a/tests/test_page.py +++ b/tests/test_page.py @@ -263,13 +263,6 @@ class TestPageApiArgs(unittest.TestCase): assert args['rvexpandtemplates'] == '1' - def test_get_text_expanded_deprecated(self): - # Check that the 'rvexpandtemplates' parameter is sent to the API - text = self.page.get_expanded() - args = self.get_last_api_call_args() - - assert args['rvexpandtemplates'] == '1' - if __name__ == '__main__': unittest.main() -- GitLab