Revision: 4186 Author: wikipedian Date: 2007-09-03 10:35:56 +0000 (Mon, 03 Sep 2007)
Log Message: ----------- fixed serious bug: summary message wasn't used properly if more than one pair of replacement items was given via the command line.
Modified Paths: -------------- trunk/pywikipedia/replace.py
Modified: trunk/pywikipedia/replace.py =================================================================== --- trunk/pywikipedia/replace.py 2007-09-03 07:17:17 UTC (rev 4185) +++ trunk/pywikipedia/replace.py 2007-09-03 10:35:56 UTC (rev 4186) @@ -373,7 +373,10 @@ for i in xrange (0,len(commandline_replacements),2): replacements.append((commandline_replacements[i], commandline_replacements[i+1])) - + if summary_commandline == None: + pairs = [(commandline_replacements[i], commandline_replacements[i + 1]) for i in range(0, len(commandline_replacements), 2)] + replacementsDescription = '(' + ', '.join([('-' + pair[0] + ' +' + pair[1]) for pair in pairs]) + ')' + wikipedia.setAction(wikipedia.translate(wikipedia.getSite(), msg ) % replacementsDescription) else: raise wikipedia.Error, 'Specifying -fix with replacements is undefined' elif fix == None: