[Pywikipedia-l] SVN: [6221] trunk/pywikipedia/category_redirect.py
russblau at svn.wikimedia.org
russblau at svn.wikimedia.org
Mon Jan 5 13:49:21 UTC 2009
Revision: 6221
Author: russblau
Date: 2009-01-05 13:49:21 +0000 (Mon, 05 Jan 2009)
Log Message:
-----------
handle null edits better
Modified Paths:
--------------
trunk/pywikipedia/category_redirect.py
Modified: trunk/pywikipedia/category_redirect.py
===================================================================
--- trunk/pywikipedia/category_redirect.py 2009-01-05 13:48:05 UTC (rev 6220)
+++ trunk/pywikipedia/category_redirect.py 2009-01-05 13:49:21 UTC (rev 6221)
@@ -156,13 +156,14 @@
"""
oldtext = article.get(get_redirect=True, force=True)
newtext = wikipedia.replaceCategoryInPlace(oldtext, oldCat, newCat)
- if newtext == oldtext:
- wikipedia.output(
- u'No changes in made in page %s.' % article.aslink())
+ try:
# even if no changes, still save the page, in case it needs
# an update due to changes in a transcluded template
- try:
article.put(newtext, comment)
+ if newtext == oldtext:
+ wikipedia.output(
+ u'No changes in made in page %s.' % article.aslink())
+ return False
return True
except wikipedia.EditConflict:
wikipedia.output(
More information about the Pywikipedia-l
mailing list