Revision: 8161 Author: xqt Date: 2010-05-14 08:37:03 +0000 (Fri, 14 May 2010)
Log Message: ----------- bugfix for #3000806 introduced with r6609
Modified Paths: -------------- trunk/pywikipedia/standardize_notes.py
Modified: trunk/pywikipedia/standardize_notes.py =================================================================== --- trunk/pywikipedia/standardize_notes.py 2010-05-14 07:58:30 UTC (rev 8160) +++ trunk/pywikipedia/standardize_notes.py 2010-05-14 08:37:03 UTC (rev 8161) @@ -329,7 +329,9 @@ yield wikipedia.Page(wikipedia.getSite(), pagename)
class ReplaceRobot: - def __init__(self, generator, replacements, refsequence, references, refusage, exceptions = [], regex = False, acceptall = False): + def __init__(self, generator, replacements, refsequence, references, + refusage, exceptions = [], regex = False, acceptall = False, + summary = ''): self.generator = generator self.replacements = replacements self.exceptions = exceptions @@ -338,6 +340,7 @@ self.references = references self.refsequence = refsequence self.refusage = refusage + self.summary = summary
def checkExceptions(self, original_text): """ @@ -998,7 +1001,7 @@ if choice in ['a', 'A']: self.acceptall = True if self.acceptall or choice in ['y', 'Y']: - pl.put(new_text) + pl.put(new_text, self.summary)
def main(): # How we want to retrieve information on which pages need to be changed. @@ -1063,7 +1066,8 @@ source = 'sqldump' elif arg.startswith('-page'): if len(arg) == 5: - pagenames.append(wikipedia.input(u'Which page do you want to chage?')) + pagenames.append( + wikipedia.input(u'Which page do you want to change?')) else: pagenames.append(arg[6:]) source = 'userinput' @@ -1109,9 +1113,11 @@ exceptions = fix['exceptions'] replacements = fix['replacements']
- gen = ReplacePageGenerator(source, replacements, exceptions, regex, namespace, textfilename, sqlfilename, categoryname, pagenames) + gen = ReplacePageGenerator(source, replacements, exceptions, regex, namespace, + textfilename, sqlfilename, categoryname, pagenames) preloadingGen = pagegenerators.PreloadingGenerator(gen, pageNumber = 20) - bot = ReplaceRobot(preloadingGen, replacements, refsequence, references, refusage, exceptions, regex, acceptall, editSummary) + bot = ReplaceRobot(preloadingGen, replacements, refsequence, references, + refusage, exceptions, regex, acceptall, editSummary) bot.run()