Revision: 5036 Author: russblau Date: 2008-02-15 21:00:20 +0000 (Fri, 15 Feb 2008)
Log Message: ----------- have change_category() return a bool to indicate whether the change was successful.
Modified Paths: -------------- trunk/pywikipedia/catlib.py
Modified: trunk/pywikipedia/catlib.py =================================================================== --- trunk/pywikipedia/catlib.py 2008-02-15 20:13:03 UTC (rev 5035) +++ trunk/pywikipedia/catlib.py 2008-02-15 21:00:20 UTC (rev 5036) @@ -415,9 +415,10 @@ if newtext == oldtext: wikipedia.output( u'No changes in made in page %s.' % article.aslink()) - return + return False try: article.put(newtext, comment) + return True except wikipedia.EditConflict: wikipedia.output( u'Skipping %s because of edit conflict' % article.aslink()) @@ -434,7 +435,7 @@ except wikipedia.PageNotSaved, error: wikipedia.output(u"Saving page %s failed: %s" % (article.aslink(), error.message)) - return + return False
# This loop will replace all occurrences of the category to be changed, # and remove duplicates.