http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10873
Revision: 10873 Author: xqt Date: 2013-01-04 14:22:17 +0000 (Fri, 04 Jan 2013) Log Message: ----------- some updates from trunk, strip trailing white space, PEP8 changes
Modified Paths: -------------- branches/rewrite/scripts/blockpageschecker.py branches/rewrite/scripts/category_redirect.py branches/rewrite/scripts/cosmetic_changes.py branches/rewrite/scripts/imageuncat.py branches/rewrite/scripts/interwiki.py branches/rewrite/scripts/noreferences.py branches/rewrite/scripts/solve_disambiguation.py branches/rewrite/scripts/upload.py
Modified: branches/rewrite/scripts/blockpageschecker.py =================================================================== --- branches/rewrite/scripts/blockpageschecker.py 2013-01-04 13:40:24 UTC (rev 10872) +++ branches/rewrite/scripts/blockpageschecker.py 2013-01-04 14:22:17 UTC (rev 10873) @@ -191,7 +191,7 @@ def showQuest(site, page): quest = pywikibot.inputChoice(u'Do you want to open the page?', ['with browser', 'with gui', 'no'], - ['b','g','n'], 'n') + ['b', 'g', 'n'], 'n') pathWiki = site.family.nicepath(site.lang) url = 'http://%s%s%s?&redirect=no' % (pywikibot.getSite().hostname(), pathWiki, page.urlname())
Modified: branches/rewrite/scripts/category_redirect.py =================================================================== --- branches/rewrite/scripts/category_redirect.py 2013-01-04 13:40:24 UTC (rev 10872) +++ branches/rewrite/scripts/category_redirect.py 2013-01-04 14:22:17 UTC (rev 10873) @@ -60,6 +60,7 @@ 'no': "Kategori:Wikipedia omdirigertekategorier", 'pl': "Kategoria:Przekierowania kategorii", 'pt': "Categoria:!Redirecionamentos de categorias", + 'ru': "Категория:Википедия:Категории-дубликаты", 'simple': "Category:Category redirects", 'vi': u"Thể loại:Thể loại đổi hướng", 'zh': u"Category:已重定向的分类",
Modified: branches/rewrite/scripts/cosmetic_changes.py =================================================================== --- branches/rewrite/scripts/cosmetic_changes.py 2013-01-04 13:40:24 UTC (rev 10872) +++ branches/rewrite/scripts/cosmetic_changes.py 2013-01-04 14:22:17 UTC (rev 10873) @@ -95,7 +95,7 @@ 'fr' : u'<!-- Autres langues -->', 'nn' : (u'<!--interwiki (no, sv, da first; then other languages alphabetically by name)-->', u'(<!-- ?interwiki \(no(?:/nb)?, ?sv, ?da first; then other languages alphabetically by name\) ?-->)') -} +}
# This is from interwiki.py; # move it to family file and implement global instances @@ -180,7 +180,7 @@ text = self.cleanUpSectionHeaders(text) text = self.putSpacesInLists(text) text = self.translateAndCapitalizeNamespaces(text) - text = self.translateMagicWords(text) +## text = self.translateMagicWords(text) text = self.replaceDeprecatedTemplates(text) ## text = self.resolveHtmlEntities(text) text = self.validXhtml(text) @@ -333,7 +333,7 @@ text = text.strip()+self.site.family.interwiki_text_separator allstars.sort() for element in allstars: - text += '%s%s' % (element.strip(),config.line_separator) + text += '%s%s' % (element.strip(), config.line_separator) pywikibot.log(u'%s' %element.strip()) # Adding the interwiki if interwikiLinks: @@ -755,7 +755,9 @@ text = pywikibot.replaceExcept(text, u'ه', u'ھ', exceptions) text = pywikibot.replaceExcept(text, u'ك', u'ک', exceptions) text = pywikibot.replaceExcept(text, ur'[ىي]', u'ی', exceptions) + return text # replace persian/arabic digits + ## deactivated due to bug #3539407 for i in xrange(0, 10): text = pywikibot.replaceExcept(text, old[i], new[i], exceptions) # do not change digits in class, style and table params
Modified: branches/rewrite/scripts/imageuncat.py =================================================================== --- branches/rewrite/scripts/imageuncat.py 2013-01-04 13:40:24 UTC (rev 10872) +++ branches/rewrite/scripts/imageuncat.py 2013-01-04 14:22:17 UTC (rev 10873) @@ -6,7 +6,7 @@ """ __version__ = '$Id$' # -# (C) Multichill 2008 +# (C) Multichill 2008 # # Distributed under the terms of the MIT license. #
Modified: branches/rewrite/scripts/interwiki.py =================================================================== --- branches/rewrite/scripts/interwiki.py 2013-01-04 13:40:24 UTC (rev 10872) +++ branches/rewrite/scripts/interwiki.py 2013-01-04 14:22:17 UTC (rev 10873) @@ -334,7 +334,7 @@ # (C) Daniel Herding, 2004 # (C) Yuri Astrakhan, 2005-2006 # (C) xqt, 2009-2012 -# (C) Pywikipedia bot team, 2007-2012 +# (C) Pywikipedia bot team, 2007-2013 # # Distributed under the terms of the MIT license. # @@ -424,7 +424,11 @@ 'pt' : ([u'documentação', u'/doc'], u'/doc'), 'ro' : (u'documentaţie', u'/doc'), 'ru' : (u'doc', u'/doc'), - 'simple': ('documentation', u'/doc'), + 'simple': ([u'documentation', + u'template documentation', + u'template doc', + u'doc', + u'documentation, template'], u'/doc'), 'sv' : (u'dokumentation', u'/dok'), 'uk' : ([u'документація', u'doc',
Modified: branches/rewrite/scripts/noreferences.py =================================================================== --- branches/rewrite/scripts/noreferences.py 2013-01-04 13:40:24 UTC (rev 10872) +++ branches/rewrite/scripts/noreferences.py 2013-01-04 14:22:17 UTC (rev 10873) @@ -26,7 +26,7 @@ and the bot will only work on that single page.
If neither a page title nor a page generator is given, it takes all pages from -the default maintenance category. +the default maintenance category.
It is strongly recommended not to run this script over the entire article namespace (using the -start) parameter, as that would consume too much
Modified: branches/rewrite/scripts/solve_disambiguation.py =================================================================== --- branches/rewrite/scripts/solve_disambiguation.py 2013-01-04 13:40:24 UTC (rev 10872) +++ branches/rewrite/scripts/solve_disambiguation.py 2013-01-04 14:22:17 UTC (rev 10873) @@ -250,6 +250,14 @@ 'fy': [ u'Wikipedy:Fangnet', ], + 'hu': [ + #hu:Wikipédia:Kocsmafal (egyéb)#Hol nem kell egyértelműsíteni? + #2012-02-08 + u'Wikipédia:(?!Sportműhely/Eddigi cikkeink).*', + u'.*(egyértelműsítő lap)$', + u'.*[Vv]ita:.*', + u'Szerkesztő:[^/]+$', + ], 'ia': [ u'Categoria:Disambiguation', u'Wikipedia:.+',
Modified: branches/rewrite/scripts/upload.py =================================================================== --- branches/rewrite/scripts/upload.py 2013-01-04 13:40:24 UTC (rev 10872) +++ branches/rewrite/scripts/upload.py 2013-01-04 14:22:17 UTC (rev 10873) @@ -140,7 +140,8 @@ # FIXME: these 2 belong somewhere else, presumably in family forbidden = '/' # to be extended allowed_formats = (u'gif', u'jpg', u'jpeg', u'mid', u'midi', - u'ogg', u'png', u'svg', u'xcf', u'djvu') + u'ogg', u'png', u'svg', u'xcf', u'djvu', + u'ogv', u'oga', u'tif', u'tiff') # ask until it's valid while True: newfn = pywikibot.input(
pywikipedia-svn@lists.wikimedia.org