Revision: 6040 Author: btongminh Date: 2008-10-28 22:15:22 +0000 (Tue, 28 Oct 2008)
Log Message: ----------- Made disallowed_replacement regex case insensitive
Modified Paths: -------------- trunk/pywikipedia/commonsdelinker/image_replacer.py
Modified: trunk/pywikipedia/commonsdelinker/image_replacer.py =================================================================== --- trunk/pywikipedia/commonsdelinker/image_replacer.py 2008-10-28 12:51:49 UTC (rev 6039) +++ trunk/pywikipedia/commonsdelinker/image_replacer.py 2008-10-28 22:15:22 UTC (rev 6040) @@ -43,7 +43,7 @@ self.config.update(getattr(config, 'Replacer', ())) self.template = re.compile(r'{{%s|([^|]*?)|([^|]*?)(?:(?:|reason=(.*?))?)}}' % \ self.config['replace_template']) - self.disallowed_replacements = [(re.compile(i[0]), re.compile(i[1])) + self.disallowed_replacements = [(re.compile(i[0], re.I), re.compile(i[1], re.I)) for i in self.config.get('disallowed_replacements', ())] self.site = wikipedia.getSite(persistent_http = True)
pywikipedia-l@lists.wikimedia.org