http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11535
Revision: 11535 Author: xqt Date: 2013-05-15 04:25:35 +0000 (Wed, 15 May 2013) Log Message: ----------- update fixes at commons, update from trunk r11534
Modified Paths: -------------- branches/rewrite/scripts/cosmetic_changes.py
Modified: branches/rewrite/scripts/cosmetic_changes.py =================================================================== --- branches/rewrite/scripts/cosmetic_changes.py 2013-05-15 04:20:42 UTC (rev 11534) +++ branches/rewrite/scripts/cosmetic_changes.py 2013-05-15 04:25:35 UTC (rev 11535) @@ -605,7 +605,7 @@ old = '[' + old[0].upper() + old[0].lower() + ']' + old[1:] text = pywikibot.replaceExcept( text, - r'{{([mM][sS][gG]:)?' + old + '(?P<parameters>|[^}]+|)}}', + r'{{([mM][sS][gG]:)?%s(?P<parameters>|[^}]+|)}}' % old, new, exceptions) return text
@@ -789,11 +789,11 @@ text = pywikibot.replaceExcept( text, r"([\r\n])== *[[Commons:Copyright tags|Licensing]]: *==", - r"\1== {{int:license}} ==", exceptions, True) + r"\1== {{int:license-header}} ==", exceptions, True) text = pywikibot.replaceExcept( text, - r"([\r\n])== *(Licensing|License information|{{int:license-header}}) *==", - r"\1== {{int:license}} ==", exceptions, True) + r"([\r\n])== *(Licensing|License information|{{int:license}}) *==", + r"\1== {{int:license-header}} ==", exceptions, True)
# frequent field values to {{int:}} versions text = pywikibot.replaceExcept( @@ -823,8 +823,8 @@ r'\1== {{int:filedesc}} ==', exceptions, True) text = pywikibot.replaceExcept( text, - r'([\r\n]|^)== *{{int:license}} *==(?:[\r\n ]*)== *{{int:license}} *==', - r'\1== {{int:license}} ==', exceptions, True) + r'([\r\n]|^)== *{{int:license-header}} *==(?:[\r\n ]*)== *{{int:license-header}} *==', + r'\1== {{int:license-header}} ==', exceptions, True) return text
pywikipedia-svn@lists.wikimedia.org