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

Change subject: Remove Wikipedia special cases from interwiki.py
......................................................................


Remove Wikipedia special cases from interwiki.py

Wikipedia now uses Wikidata for interwiki links,
so any special cases in interwiki.py for Wikipedia
are unused code.

Change-Id: I41d2b254ce265c4f44e0ad7e72790f5dc52b0014
---
M scripts/interwiki.py
1 file changed, 2 insertions(+), 64 deletions(-)

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



diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 8887c5b..7b500ca 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -145,8 +145,7 @@
                       * scand:     All Scandinavian languages.
 
                    Names of families that forward their interlanguage links
-                   to the wiki family being worked upon can be used (with
-                   -family=wikipedia only), they are:
+                   to the wiki family being worked upon can be used, they are:
                       * commons:   Interlanguage links of Mediawiki Commons.
                       * incubator: Links in pages on the Mediawiki Incubator.
                       * meta:      Interlanguage links of named pages on Meta.
@@ -348,7 +347,6 @@
 #
 
 import codecs
-import datetime
 import os
 import pickle
 import re
@@ -1723,65 +1721,9 @@
                             break
         else:
             for (site, page) in new.items():
-                # edit restriction for some templates on zh-wiki where
-                # interlanguage keys are included by /doc subpage
-                smallWikiAllowed = not (page.site.sitename == 'wikipedia:zh' 
and
-                                        page.namespace() == 10 and
-                                        u'Country data' in 
page.title(withNamespace=False))
-                # edit restriction on is-wiki
-                # https://is.wikipedia.org/wiki/Wikipediaspjall:V%C3%A9lmenni
-                # and zh-wiki for template namespace which prevents increasing 
the queue
-                # allow edits for the same conditions as -whenneeded
-                # or the last edit wasn't a bot
-                # or the last edit was 1 month ago
-                if (smallWikiAllowed and
-                    globalvar.autonomous and
-                    (page.site.sitename == 'wikipedia:is' or
-                     page.site.sitename == 'wikipedia:zh' and
-                     page.namespace() == 10
-                     )):
-                    old = {}
-                    try:
-                        for mypage in new[page.site].interwiki():
-                            old[mypage.site] = mypage
-                    except pywikibot.NoPage:
-                        pywikibot.output(u"BUG>>> %s no longer exists?"
-                                         % new[site])
-                        continue
-                    mods, mcomment, adding, removing, modifying \
-                        = compareLanguages(old, new, insite=site)
-                    # cannot create pywikibot.User with IP
-                    smallWikiAllowed = (
-                        page.isIpEdit() or
-                        len(removing) > 0 or
-                        len(old) == 0 or
-                        len(adding) + len(modifying) > 2 or
-                        (
-                            len(removing) + len(modifying) == 0 and
-                            adding == [page.site]
-                        )
-                    )
-                    if not smallWikiAllowed:
-                        user = pywikibot.User(page.site, page.userName())
-                        # erstmal auch keine namen mit bot
-                        if 'bot' not in user.groups() \
-                           and 'bot' not in page.userName().lower():
-                            smallWikiAllowed = True
-                        else:
-                            _now = datetime.datetime.utcnow()
-                            _editTime = page.editTime()
-                            if abs((_now - _editTime).days) > 30:
-                                smallWikiAllowed = True
-                            else:
-                                pywikibot.output(
-                                    u'NOTE: number of edits are restricted at 
%s'
-                                    % page.site.sitename
-                                )
-
                 # if we have an account for this site
                 if site.family.name in config.usernames and \
                    site.code in config.usernames[site.family.name] and \
-                   smallWikiAllowed and \
                    not site.has_transcluded_data:
                     # Try to do the changes
                     try:
@@ -1915,11 +1857,7 @@
                 # put it to new means don't delete it
                 if (
                     not globalvar.cleanup or
-                    unicode(rmPage) not in globalvar.remove or
-                    (
-                        rmPage.site.sitename() == 'wikipedia:hi' and
-                        page.site.sitename() != 'wikipedia:de'  # work-arround 
for bug #3081100 (do not remove hi-pages)
-                    )
+                    unicode(rmPage) not in globalvar.remove
                 ):
                     new[rmsite] = rmPage
                     pywikibot.output(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I41d2b254ce265c4f44e0ad7e72790f5dc52b0014
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to