Revision: 5396 Author: nicdumz Date: 2008-05-18 11:33:23 +0000 (Sun, 18 May 2008)
Log Message: ----------- Catching PageNotSaved , related to bug #1966402
Modified Paths: -------------- trunk/pywikipedia/catlib.py
Modified: trunk/pywikipedia/catlib.py =================================================================== --- trunk/pywikipedia/catlib.py 2008-05-18 10:53:07 UTC (rev 5395) +++ trunk/pywikipedia/catlib.py 2008-05-18 11:33:23 UTC (rev 5396) @@ -410,6 +410,9 @@ site = article.site() changesMade = False
+ if not article.canBeEdited(): + wikipedia.output("Can't edit %s, skipping it..." & article.aslink()) + return False if inPlace == True: oldtext = article.get(nofollow_redirects=True) newtext = wikipedia.replaceCategoryInPlace(oldtext, oldCat, newCat) @@ -481,6 +484,9 @@ except wikipedia.LockedPage: wikipedia.output( u'Skipping %s because page is locked' % article.title()) + except wikipedia.PageNotSaved, error: + wikipedia.output(u"Saving page %s failed: %s" + % (article.aslink(), error.message))
def test(): site = wikipedia.getSite()