jenkins-bot has submitted this change and it was merged.

Change subject: Remove dead code from Page.isDisambig()
......................................................................


Remove dead code from Page.isDisambig()

Since a62b2475323efb5b694ae98444130b13d275de68 the method
has been using the Disambiguator extension, enabled on enwiki
since commit a8842532de8c403c755bfa42d90714addb690e38 of the
operations/mediawiki-config repository.

Change-Id: I0ceedd1728322dc4761bd74da1dca3a4088633f6
---
M pywikibot/page.py
1 file changed, 2 insertions(+), 15 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/page.py b/pywikibot/page.py
index 914e548..b364488 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -768,7 +768,8 @@
         """Return True if this is an image description page, False 
otherwise."""
         return self.namespace() == 6
 
-    def isDisambig(self, get_Index=True):
+    @remove_last_args(('get_Index', ))
+    def isDisambig(self):
         """Return True if this is a disambiguation page, False otherwise.
 
         Relies on the presence of specific templates, identified in
@@ -779,9 +780,6 @@
         if the value in the Family file is None no entry was made, looks for
         the list on [[MediaWiki:Disambiguationspage]]. If this page does not
         exist, take the MediaWiki message.
-
-        If get_Index is True then also load the templates for index articles
-        which are given on en-wiki
 
         'Template:Disambig' is always assumed to be default, and will be
         appended regardless of its existence.
@@ -805,18 +803,10 @@
             if distl is None:
                 disambigpages = Page(self.site,
                                      "MediaWiki:Disambiguationspage")
-                indexes = set()
                 if disambigpages.exists():
                     disambigs = set(link.title(withNamespace=False)
                                     for link in disambigpages.linkedPages()
                                     if link.namespace() == 10)
-                    # cache index article templates separately
-                    if self.site.sitename() == 'wikipedia:en':
-                        regex = re.compile('\(\((.+?)\)\)')
-                        content = disambigpages.get()
-                        for index in regex.findall(content):
-                            indexes.add(first_upper(index))
-                        self.site._indextemplates = indexes
                 else:
                     message = self.site.mediawiki_message(
                         'disambiguationspage').split(':', 1)[1]
@@ -834,9 +824,6 @@
         disambigs = set()
         # always use cached disambig templates
         disambigs.update(self.site._disambigtemplates)
-        # if get_Index is True, also use cached index templates
-        if get_Index and hasattr(self.site, '_indextemplates'):
-            disambigs.update(self.site._indextemplates)
         # see if any template on this page is in the set of disambigs
         disambigInPage = disambigs.intersection(templates)
         return self.namespace() != 10 and len(disambigInPage) > 0

-- 
To view, visit https://gerrit.wikimedia.org/r/221137
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0ceedd1728322dc4761bd74da1dca3a4088633f6
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Ricordisamoa <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to