http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9293
Revision: 9293
Author: filnik
Date: 2011-06-12 08:54:37 +0000 (Sun, 12 Jun 2011)
Log Message:
-----------
changing commons message
Modified Paths:
--------------
trunk/pywikipedia/checkimages.py
Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py 2011-06-10 04:48:10 UTC (rev 9292)
+++ trunk/pywikipedia/checkimages.py 2011-06-12 08:54:37 UTC (rev 9293)
@@ -272,8 +272,10 @@
# That's the text that the bot will add if it doesn't find the license.
# Note: every __botnick__ will be repleaced with your bot's nickname (feel free not to use if you don't need it)
nothing_notification = {
- 'commons':u"\n{{subst:User:Filnik/untagged|File:%s}}\n\n''This message was '''added automatically by [[User:" + \
- "__botnick__|__botnick__]]''', if you need some help about it, please use the [[Commons:Help desk]]''. --~~~~",
+ 'commons':u"\n{{subst:User:Filnik/untagged|File:%s}}\n\n''This message was '''added automatically by " + \
+ "__botnick__''', if you need some help about it, please read the text above again and follow the links in it," + \
+ "if you still need help ask at the [[File:Human-help-browser.svg|18px|link=Commons:Help desk|?]] '''[[Commons:Help desk|->]]" + \
+ "[[Commons:Help desk]]''' in any language you like to use.'' --__botnick__ ~~~~~""",
'ar' :u"{{subst:مصدر الصورة|File:%s}} --~~~~",
'de' :u'\n{{subst:Benutzer:ABF/D2|%s}} ~~~~ ',
'en' :u"{{subst:image source|File:%s}} --~~~~",
@@ -417,7 +419,7 @@
# Note: every __botnick__ will be repleaced with your bot's nickname (feel free not to use if you don't need it)
HiddenTemplateNotification = {
'_default':None,
- 'commons': u"""\n{{subst:User:Filnik/whitetemplate|File:%s}}\n\n''This message was added automatically by __botnick__, if you need some help about it please read the text above again and follow the links in it, if you still need help ask at the [[File:Human-help-browser.svg|18px|link=Commons:Help desk|?]] '''[[Commons:Help desk|→]] [[Commons:Help desk]]''' in any language you like to use.'' --__botnick__""",
+ 'commons': u"""\n{{subst:User:Filnik/whitetemplate|File:%s}}\n\n''This message was added automatically by __botnick__, if you need some help about it please read the text above again and follow the links in it, if you still need help ask at the [[File:Human-help-browser.svg|18px|link=Commons:Help desk|?]] '''[[Commons:Help desk|→]] [[Commons:Help desk]]''' in any language you like to use.'' --__botnick__ ~~~~~""",
'it' : u"{{subst:Progetto:Coordinamento/Immagini/Bot/Messaggi/Template_insufficiente|%s|__botnick__}} --~~~~",
'ko' : u"\n{{subst:User:Kwj2772/whitetemplates|%s}} --~~~~",
}
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9289
Revision: 9289
Author: huji
Date: 2011-06-05 23:50:50 +0000 (Sun, 05 Jun 2011)
Log Message:
-----------
When a list is returned for the namespace, the first element of the list is the actual namespace name. Before this change, bot threw error messages when used on a wiki with custom namespaces
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2011-06-05 20:12:25 UTC (rev 9288)
+++ trunk/pywikipedia/wikipedia.py 2011-06-05 23:50:50 UTC (rev 9289)
@@ -7049,7 +7049,7 @@
value = namespace.get('_default', None)
if value:
if isinstance(value, list):
- defaults += value
+ defaults += value[0]
else:
defaults.append(value)
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9288
Revision: 9288
Author: huji
Date: 2011-06-05 20:12:25 +0000 (Sun, 05 Jun 2011)
Log Message:
-----------
(bug 3311663) Error in duplicate removal code:
Wikis using customized permissions cause dict objects to be parsed out of the text by Query.GetData when permissions are parsed out
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2011-06-04 10:13:18 UTC (rev 9287)
+++ trunk/pywikipedia/wikipedia.py 2011-06-05 20:12:25 UTC (rev 9288)
@@ -5576,7 +5576,13 @@
# Get user groups and rights
if 'groups' in text:
- self._rights[index] = text['groups']
+ self._rights[index] = []
+ for group in text['groups']:
+ # Convert dictionaries to list items (bug 3311663)
+ if isinstance(group, dict):
+ self._rights[index].extend(group.keys())
+ else:
+ self._rights[index].append(group)
self._rights[index].extend(text['rights'])
# Warnings
# Don't show warnings for not logged in users, they will just fail to
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9287
Revision: 9287
Author: multichill
Date: 2011-06-04 10:13:18 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
* Change list of categories to ignore
* Skip {{int:....}} templates
Modified Paths:
--------------
trunk/pywikipedia/imageuncat.py
Modified: trunk/pywikipedia/imageuncat.py
===================================================================
--- trunk/pywikipedia/imageuncat.py 2011-06-03 10:37:42 UTC (rev 9286)
+++ trunk/pywikipedia/imageuncat.py 2011-06-04 10:13:18 UTC (rev 9287)
@@ -19,13 +19,14 @@
from datetime import timedelta
#Probably unneeded because these are hidden categories. Have to figure it out.
-ignoreCategories = [u'[[Category:CC-BY-SA-3.0]]',
- u'[[Category:GFDL]]',
- u'[[Category:Media for cleanup]]',
- u'[[Category:Media lacking a description]]',
- u'[[Category:Media lacking author information]]',
- u'[[Category:Media lacking a description]]',
- u'[[Category:Self-published work]]']
+ignoreCategories = [u'Category:CC-BY-SA-3.0',
+ u'Category:GFDL',
+ u'Category:Media for cleanup',
+ u'Category:Media lacking a description',
+ u'Category:Media lacking author information',
+ u'Category:Media lacking a description',
+ u'Category:Self-published work',
+ u'Category:Uploaded with UploadWizard',]
#Dont bother to put the template on a image with one of these templates
skipTemplates = [u'Delete',
@@ -1293,9 +1294,10 @@
pywikibot.output(u'Working on '+ page.title())
for category in page.categories():
- if category not in ignoreCategories:
+ if category.title() not in ignoreCategories:
pywikibot.output(u'Got category ' + category.title())
return False
+ #FIXME: Add check if the category is hidden. If hidden -> ignore
for templateWithTrail in page.templates():
#Strip of trailing garbage
@@ -1304,6 +1306,8 @@
# Already tagged with a template, skip it
pywikibot.output(u'Already tagged, skip it')
return False
+ elif template.startswith(u'Int:'):
+ pywikibot.output(u'Ignoring internationalization template ' + template)
elif template in ignoreTemplates:
# template not relevant for categorization
pywikibot.output(u'Ignore ' + template)