http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10634
Revision: 10634
Author: xqt
Date: 2012-10-31 16:58:50 +0000 (Wed, 31 Oct 2012)
Log Message:
-----------
revert r8307 due to bug #3582204
Modified Paths:
--------------
trunk/pywikipedia/pywikibot/textlib.py
Modified: trunk/pywikipedia/pywikibot/textlib.py
===================================================================
--- trunk/pywikipedia/pywikibot/textlib.py 2012-10-31 16:57:22 UTC (rev 10633)
+++ trunk/pywikipedia/pywikibot/textlib.py 2012-10-31 16:58:50 UTC (rev 10634)
@@ -81,7 +81,7 @@
# templates cascaded up to level 2, but no deeper. For arbitrary
# depth, we'd need recursion which can't be done in Python's re.
# After all, the language of correct parenthesis words is not regular.
- 'template': re.compile(r'(?s){{(({{.*?}})|.)*}}'),
+ 'template': re.compile(r'(?s){{(({{.*?}})?.*?)*}}'),
'hyperlink': compileLinkR(),
'gallery': re.compile(r'(?is)<gallery.*?>.*?</gallery>'),
# this matches internal wikilinks, but also interwiki, categories, and
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10633
Revision: 10633
Author: xqt
Date: 2012-10-31 16:57:22 +0000 (Wed, 31 Oct 2012)
Log Message:
-----------
revert r8307 due to bug #3582204
Modified Paths:
--------------
branches/rewrite/pywikibot/textlib.py
Modified: branches/rewrite/pywikibot/textlib.py
===================================================================
--- branches/rewrite/pywikibot/textlib.py 2012-10-31 11:39:46 UTC (rev 10632)
+++ branches/rewrite/pywikibot/textlib.py 2012-10-31 16:57:22 UTC (rev 10633)
@@ -83,7 +83,7 @@
# templates cascaded up to level 2, but no deeper. For arbitrary
# depth, we'd need recursion which can't be done in Python's re.
# After all, the language of correct parenthesis words is not regular.
- 'template': re.compile(r'(?s){{(({{.*?}})|.)*}}'),
+ 'template': re.compile(r'(?s){{(({{.*?}})?.*?)*}}'),
'hyperlink': compileLinkR(),
'gallery': re.compile(r'(?is)<gallery.*?>.*?</gallery>'),
# this matches internal wikilinks, but also interwiki, categories, and
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10632
Revision: 10632
Author: xqt
Date: 2012-10-31 11:39:46 +0000 (Wed, 31 Oct 2012)
Log Message:
-----------
use userinterface_lang = 'en' for now to enable its use for twtranslate by interwiki.py
Modified Paths:
--------------
trunk/pywikipedia/config.py
Modified: trunk/pywikipedia/config.py
===================================================================
--- trunk/pywikipedia/config.py 2012-10-31 11:37:00 UTC (rev 10631)
+++ trunk/pywikipedia/config.py 2012-10-31 11:39:46 UTC (rev 10632)
@@ -124,7 +124,7 @@
# i18n setting for user interface language
# default is config.mylang or 'en'
-userinterface_lang = None
+userinterface_lang = 'en' # None
# Should we transliterate characters that do not exist in the console
# character set?
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10631
Revision: 10631
Author: xqt
Date: 2012-10-31 11:37:00 +0000 (Wed, 31 Oct 2012)
Log Message:
-----------
new message for modifying one page only showing the old one
Modified Paths:
--------------
branches/rewrite/scripts/interwiki.py
Modified: branches/rewrite/scripts/interwiki.py
===================================================================
--- branches/rewrite/scripts/interwiki.py 2012-10-31 11:31:14 UTC (rev 10630)
+++ branches/rewrite/scripts/interwiki.py 2012-10-31 11:37:00 UTC (rev 10631)
@@ -2292,6 +2292,11 @@
commentname += '-removing'
if modifying:
commentname += '-modifying'
+ if commentname == 'interwiki-modifying' and len(modifying) == 1:
+ useFrom = True
+ commentname += '-from'
+ else:
+ useFrom = False
if adding or removing or modifying:
#Version info marks bots without unicode error
@@ -2303,7 +2308,8 @@
changes = {'adding': ', '.join([fmt(new, x) for x in adding]),
'removing': ', '.join([fmt(old, x) for x in removing]),
- 'modifying': ', '.join([fmt(new, x) for x in modifying])}
+ 'modifying': ', '.join([fmt(new, x) for x in modifying]),
+ 'from': u'' if not useFrom else old[modifying[0]]}
mcomment += i18n.twtranslate(insite.lang, commentname) % changes
mods = i18n.twtranslate('en', commentname) % changes
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10629
Revision: 10629
Author: xqt
Date: 2012-10-31 11:01:24 +0000 (Wed, 31 Oct 2012)
Log Message:
-----------
edit restriction for some templates on zh-wiki where interlanguage keys are included in /doc sub-page
Modified Paths:
--------------
trunk/pywikipedia/interwiki.py
Modified: trunk/pywikipedia/interwiki.py
===================================================================
--- trunk/pywikipedia/interwiki.py 2012-10-31 10:48:28 UTC (rev 10628)
+++ trunk/pywikipedia/interwiki.py 2012-10-31 11:01:24 UTC (rev 10629)
@@ -1654,14 +1654,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.site.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.site.namespace() == 10):
old={}
try:
for mypage in new[page.site].interwiki():
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10627
Revision: 10627
Author: xqt
Date: 2012-10-31 08:16:15 +0000 (Wed, 31 Oct 2012)
Log Message:
-----------
must be data in shared_data_repository(), fix for r10626
Modified Paths:
--------------
branches/rewrite/pywikibot/families/wikidata_family.py
Modified: branches/rewrite/pywikibot/families/wikidata_family.py
===================================================================
--- branches/rewrite/pywikibot/families/wikidata_family.py 2012-10-31 07:47:37 UTC (rev 10626)
+++ branches/rewrite/pywikibot/families/wikidata_family.py 2012-10-31 08:16:15 UTC (rev 10627)
@@ -15,7 +15,7 @@
'client': 'wikidata-test-client.wikimedia.de',
}
- def shared_image_repository(self, code):
+ def shared_data_repository(self, code):
# for here an now we just use the test repo
# for wikimedia families the method can return wikidata itself
return ('repo', 'wikidata')
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10626
Revision: 10626
Author: xqt
Date: 2012-10-31 07:47:37 +0000 (Wed, 31 Oct 2012)
Log Message:
-----------
shared_data_repository() introduced for wikidata clients
Modified Paths:
--------------
branches/rewrite/pywikibot/families/wikidata_family.py
Modified: branches/rewrite/pywikibot/families/wikidata_family.py
===================================================================
--- branches/rewrite/pywikibot/families/wikidata_family.py 2012-10-31 07:33:23 UTC (rev 10625)
+++ branches/rewrite/pywikibot/families/wikidata_family.py 2012-10-31 07:47:37 UTC (rev 10626)
@@ -4,12 +4,18 @@
from pywikibot import family
-# The test wikidata family
+# The wikidata families
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'wikidata'
self.langs = {
+ 'wikidata': 'wikidata.org',
'repo': 'wikidata-test-repo.wikimedia.de',
'client': 'wikidata-test-client.wikimedia.de',
}
+
+ def shared_image_repository(self, code):
+ # for here an now we just use the test repo
+ # for wikimedia families the method can return wikidata itself
+ return ('repo', 'wikidata')