http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10136
Revision: 10136 Author: xqt Date: 2012-04-20 10:59:32 +0000 (Fri, 20 Apr 2012) Log Message: ----------- enable regex/replacements as a dictionary for different langs
Modified Paths: -------------- trunk/pywikipedia/replace.py
Modified: trunk/pywikipedia/replace.py =================================================================== --- trunk/pywikipedia/replace.py 2012-04-18 16:22:51 UTC (rev 10135) +++ trunk/pywikipedia/replace.py 2012-04-20 10:59:32 UTC (rev 10136) @@ -855,9 +855,12 @@ caseInsensitive = fix['nocase'] try: replacements = fix['replacements'] + # enable regex/replacements as a dictionary for different langs + if isinstance(replacements, dict): + replacements = replacements[pywikibot.getSite().lang] except KeyError: pywikibot.output( - u"No replacements given in fix, don't joke with me!") + u"No replacements given in fix, don't joke with me!") return
# Set the regular expression flags
pywikipedia-svn@lists.wikimedia.org