jenkins-bot submitted this change.
[cleanup] Remove deprecated code parts
- remove APISite.resolvemagicwords()
- remove BaseSite.ns_index()
- remove BaseSite.getNamespaceIndex()
- update tests
Change-Id: I650f86101fe206ee2bf1340a0c9262bf375a00dc
---
M pywikibot/site/_apisite.py
M pywikibot/site/_basesite.py
M tests/site_tests.py
3 files changed, 0 insertions(+), 33 deletions(-)
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index eb94bae..9619c38 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -822,15 +822,6 @@
return self._magicwords[word]
return [word]
- @deprecated('expand_text', since='20150831', future_warning=True)
- def resolvemagicwords(self, wikitext): # pragma: no cover
- """
- Replace the {{ns:xx}} marks in a wikitext with the namespace names.
-
- DEPRECATED.
- """
- return self.expand_text(wikitext)
-
@remove_last_args(('default', ))
def redirect(self):
"""Return the localized #REDIRECT keyword."""
diff --git a/pywikibot/site/_basesite.py b/pywikibot/site/_basesite.py
index 34f9750..7c790f8 100644
--- a/pywikibot/site/_basesite.py
+++ b/pywikibot/site/_basesite.py
@@ -242,25 +242,6 @@
yield base_path + '?title='
yield self.article_path
- @deprecated('APISite.namespaces.lookup_name', since='20150703',
- future_warning=True)
- def ns_index(self, namespace): # pragma: no cover
- """
- Return the Namespace for a given namespace name.
-
- @param namespace: name
- @type namespace: str
- @return: The matching Namespace object on this Site
- @rtype: Namespace, or None if invalid
- """
- return self.namespaces.lookup_name(namespace)
-
- @deprecated('APISite.namespaces.lookup_name', since='20150703',
- future_warning=True) # noqa: N802
- def getNamespaceIndex(self, namespace):
- """DEPRECATED: Return the Namespace for a given namespace name."""
- return self.namespaces.lookup_name(namespace)
-
def _build_namespaces(self):
"""Create default namespaces."""
return Namespace.builtin_namespaces()
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 877445d..b3362b5 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -78,11 +78,6 @@
self.assertFalse(page.isRedirectPage())
self.assertOneDeprecation()
- def test_ns_index(self):
- """Test ns_index."""
- self.assertEqual(self.site.ns_index('MediaWiki'), 8)
- self.assertOneDeprecation()
-
def test_namespace_shortcuts(self):
"""Test namespace shortcuts."""
self.assertEqual(self.site.image_namespace(), self.site.namespace(6))
To view, visit change 680256. To unsubscribe, or for help writing mail filters, visit settings.