[Pywikipedia-l] SVN: [6578] branches/rewrite/scripts/category_redirect.py

russblau at svn.wikimedia.org russblau at svn.wikimedia.org
Mon Apr 6 12:50:02 UTC 2009


Revision: 6578
Author:   russblau
Date:     2009-04-06 12:50:02 +0000 (Mon, 06 Apr 2009)

Log Message:
-----------
Improve category change message for English (translations for other languages welcome)

Modified Paths:
--------------
    branches/rewrite/scripts/category_redirect.py

Modified: branches/rewrite/scripts/category_redirect.py
===================================================================
--- branches/rewrite/scripts/category_redirect.py	2009-04-05 11:19:22 UTC (rev 6577)
+++ branches/rewrite/scripts/category_redirect.py	2009-04-06 12:50:02 UTC (rev 6578)
@@ -101,7 +101,8 @@
 
         self.move_comment = {
             'en':
-u"Robot: moving pages out of redirected category",
+u"Robot: change redirected category [[:%(oldCatLink)s|%(oldCatTitle)s]]"
+u" to [[:%(newCatLink)s|%(newCatTitle)s]]",
             'ar':
 u"روبوت: نقل الصفحات من تصنيف محول",
             'hu':
@@ -110,13 +111,11 @@
 u"ロボットによる: 移行中のカテゴリからのカテゴリ変更",
             'no':
 u"Robot: Flytter sider ut av omdirigeringskategori",
-            'commons':
-u'Robot: Changing category link (following [[Template:Category redirect|category redirect]])'
         }
 
         self.redir_comment = {
             'en':
-u"Robot: adding category redirect template for maintenance",
+u"Robot: add category redirect template for maintenance",
             'ar':
 u"روبوت: إضافة قالب تحويل تصنيف للصيانة",
             'hu':
@@ -128,7 +127,7 @@
         }
 
         self.dbl_redir_comment = {
-            'en': u"Robot: fixing double-redirect",
+            'en': u"Robot: fix double-redirect",
             'ar': u"روبوت: تصليح تحويلة مزدوجة",
             'hu': u"Bot: Kettős átirányítás javítása",
             'ja': u"ロボットによる: 二重リダイレクト修正",
@@ -148,7 +147,6 @@
 The following protected pages have been detected as requiring updates to \
 category links:
 %s
-~~~~
 """,
             })
 
@@ -220,12 +218,15 @@
                 newCat = pywikibot.Category(self.site,
                                             self.catprefix + newCatTitle)
 
+                oldCatLink = oldCat.title()
+                newCatLink = newCat.title()
+                comment = editSummary % locals()
                 # Move articles
                 found, moved = 0, 0
                 for article in oldCat.members():
                     found += 1
                     changed = self.change_category(article, oldCat, newCat,
-                                                   comment=editSummary)
+                                                   comment=comment)
                     if changed: moved += 1
 
                 # pass 2: look for template doc pages
@@ -241,7 +242,7 @@
                     except pywikibot.Error:
                         continue
                     changed = self.change_category(doc, oldCat, newCat,
-                                                   comment=editSummary)
+                                                   comment=comment)
                     if changed: moved += 1
 
                 if found:





More information about the Pywikipedia-l mailing list