http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11019
Revision: 11019
Author: xqt
Date: 2013-01-30 23:56:18 +0000 (Wed, 30 Jan 2013)
Log Message:
-----------
cross update trunk/rewrite
Modified Paths:
--------------
branches/rewrite/scripts/interwiki.py
trunk/pywikipedia/families/wikipedia_family.py
trunk/pywikipedia/interwiki.py
Modified: branches/rewrite/scripts/interwiki.py
===================================================================
--- branches/rewrite/scripts/interwiki.py 2013-01-30 23:43:37 UTC (rev 11018)
+++ branches/rewrite/scripts/interwiki.py 2013-01-30 23:56:18 UTC (rev 11019)
@@ -1651,14 +1651,21 @@
break
else:
for (site, page) in new.iteritems():
+ # 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
#
http://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
- smallWikiAllowed = True
- if globalvar.autonomous and (page.site.sitename() ==
'wikipedia:is' or
- page.site.sitename() ==
'wikipedia:zh'):
+ 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():
@@ -1693,9 +1700,10 @@
% page.site.sitename())
# if we have an account for this site
- if site.family.name in config.usernames \
- and site.lang in config.usernames[site.family.name] \
- and smallWikiAllowed:
+ if site.family.name in config.usernames and \
+ site.lang in config.usernames[site.family.name] and \
+ smallWikiAllowed and \
+ not site.has_transcluded_data:
# Try to do the changes
try:
if self.replaceLinks(page, new):
Modified: trunk/pywikipedia/families/wikipedia_family.py
===================================================================
--- trunk/pywikipedia/families/wikipedia_family.py 2013-01-30 23:43:37 UTC (rev 11018)
+++ trunk/pywikipedia/families/wikipedia_family.py 2013-01-30 23:56:18 UTC (rev 11019)
@@ -1533,7 +1533,7 @@
return self.code2encoding(code),
def shared_data_repository(self, code, transcluded=False):
- if not transcluded or code in ['he','hu','it']:
+ if not transcluded or code in ['he', 'hu', 'it']:
return ('wikidata', 'wikidata')
else:
return (None, None)
Modified: trunk/pywikipedia/interwiki.py
===================================================================
--- trunk/pywikipedia/interwiki.py 2013-01-30 23:43:37 UTC (rev 11018)
+++ trunk/pywikipedia/interwiki.py 2013-01-30 23:56:18 UTC (rev 11019)
@@ -1322,7 +1322,7 @@
iw = page.interwiki()
except pywikibot.NoSuchSite:
if not globalvar.quiet or pywikibot.verbose:
- pywikibot.output(u"NOTE: site %s does not exist" %
page.site())
+ pywikibot.output(u"NOTE: site %s does not exist" %
page.site)
continue
(skip, alternativePage) = self.disambigMismatch(page, counter)
@@ -1542,7 +1542,7 @@
break
return result
- def finish(self, bot = None):
+ def finish(self, bot=None):
"""Round up the subject, making any necessary changes. This
method
should be called exactly once after the todo list has gone empty.
@@ -2181,9 +2181,9 @@
return None
oc = dict(self.firstSubject().openSites())
if not oc:
- # The first subject is done. This might be a recursive call made because we
- # have to wait before submitting another modification to go live. Select
- # any language from counts.
+ # The first subject is done. This might be a recursive call made
+ # because we have to wait before submitting another modification to
+ # go live. Select any language from counts.
oc = self.counts
if pywikibot.getSite() in oc:
return pywikibot.getSite()