Revision: 7987 Author: russblau Date: 2010-03-11 15:01:00 +0000 (Thu, 11 Mar 2010)
Log Message: ----------- Always "touch" redirected category pages so that any automatically generated categories can update.
Modified Paths: -------------- branches/rewrite/scripts/category_redirect.py
Modified: branches/rewrite/scripts/category_redirect.py =================================================================== --- branches/rewrite/scripts/category_redirect.py 2010-03-11 14:54:20 UTC (rev 7986) +++ branches/rewrite/scripts/category_redirect.py 2010-03-11 15:01:00 UTC (rev 7987) @@ -320,10 +320,6 @@ global destmap, catlist, catmap
user = self.site.user() - redirect_magicwords = ["redirect"] - other_words = self.site.redirect() - if other_words: - redirect_magicwords.extend(other_words) problems = [] newredirs = []
@@ -482,8 +478,8 @@ problems.append("# %s redirects to %s" % (cat.title(asLink=True, textlink=True), dest.title(asLink=True, textlink=True))) - # do a null edit on cat to make it appear in the - # "needs repair" category (if this wiki has one) + # do a null edit on cat to update any special redirect + # categories this wiki might maintain try: cat.put(cat.get(get_redirect=True)) except: @@ -495,6 +491,11 @@ self.log_text.append(u"* Redirect loop from %s" % dest.title(asLink=True, textlink=True)) + # do a null edit on cat + try: + cat.put(cat.get(get_redirect=True)) + except: + pass else: self.log_text.append( u"* Fixed double-redirect: %s -> %s -> %s" @@ -531,6 +532,12 @@ u"* [[:%s%s]]: %d found, %d moved" % (self.catprefix, cat_title, found, moved)) counts[cat_title] = found + # do a null edit on cat + try: + cat.put(cat.get(get_redirect=True)) + except: + pass + continue
cPickle.dump(record, open(datafile, "wb"), -1)