Revision: 4336
Author: wikipedian
Date: 2007-09-20 14:51:04 +0000 (Thu, 20 Sep 2007)
Log Message:
-----------
bugfix, see [ 1794859 ] replace.py "exceptions" patch
Modified Paths:
--------------
trunk/pywikipedia/image.py
trunk/pywikipedia/replace.py
trunk/pywikipedia/template.py
Modified: trunk/pywikipedia/image.py
===================================================================
--- trunk/pywikipedia/image.py 2007-09-20 14:41:33 UTC (rev 4335)
+++ trunk/pywikipedia/image.py 2007-09-20 14:51:04 UTC (rev 4336)
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
"""
This script can be used to change one image to another or remove an image entirely.
@@ -123,8 +123,7 @@
else:
replacements.append((ImageRegex, ''))
- #Note that the [] parameter here is for exceptions (see replace.py). For now we don't use it.
- replaceBot = replace.ReplaceRobot(self.generator, replacements, [], self.always)
+ replaceBot = replace.ReplaceRobot(self.generator, replacements, acceptall = self.always)
replaceBot.run()
def main():
Modified: trunk/pywikipedia/replace.py
===================================================================
--- trunk/pywikipedia/replace.py 2007-09-20 14:41:33 UTC (rev 4335)
+++ trunk/pywikipedia/replace.py 2007-09-20 14:51:04 UTC (rev 4336)
@@ -198,7 +198,7 @@
"""
A bot that can do text replacements.
"""
- def __init__(self, generator, replacements, exceptions = [], acceptall = False, allowoverlap = False,
+ def __init__(self, generator, replacements, exceptions = {}, acceptall = False, allowoverlap = False,
recursive = False, addedCat = None):
"""
Arguments:
Modified: trunk/pywikipedia/template.py
===================================================================
--- trunk/pywikipedia/template.py 2007-09-20 14:41:33 UTC (rev 4335)
+++ trunk/pywikipedia/template.py 2007-09-20 14:51:04 UTC (rev 4336)
@@ -305,8 +305,7 @@
else:
replacements.append((templateRegex, '{{' + new + '\g<parameters>}}'))
- #Note that the [] parameter here is for exceptions (see replace.py). For now we don't use it.
- replaceBot = replace.ReplaceRobot(self.generator, replacements, [], self.acceptAll, addedCat=self.addedCat)
+ replaceBot = replace.ReplaceRobot(self.generator, replacements, exceptions = {}, acceptall = self.acceptAll, addedCat=self.addedCat)
replaceBot.run()
def main():