2008/7/9 shinjiman@svn.wikimedia.org:
Revision: 5698 Author: shinjiman Date: 2008-07-09 08:56:49 +0000 (Wed, 09 Jul 2008)
Log Message:
update messages (zh) SF.net article id 2001978 patch by Alex S.H. Lin
===================================================================
--- trunk/pywikipedia/redirect.py 2008-07-09 06:58:35 UTC (rev 5697) +++ trunk/pywikipedia/redirect.py 2008-07-09 08:56:49 UTC (rev 5698) @@ -115,6 +115,20 @@ 'zh-yue': u'機械人:跳轉目標唔存在', }
+#Summary message for put broken redirect to speedy delete +sd_tagging_sum = {
- 'en': u'Robot: Tagging for speedy deletion',
- 'ja': u'ロボットによる:迷子のリダイレクトを即時削除へ',
- 'zh':u'機器人: 將損壞的重定向提報快速刪除',
+}
+#put deletion template +sd_template = {
- 'en':u'{{db-r1}}',
- 'ja':u'{{即時削除|壊れたリダイレクト}}',
- 'zh':u'{{delete|R1}}',
+}
class RedirectGenerator: def __init__(self, xmlFilename=None, namespaces=[], offset=-1, use_move_log=False): @@ -343,7 +357,16 @@ except wikipedia.NoPage: if self.prompt(u'Redirect target %s does not exist. Do you want to delete %s?' % (targetPage.aslink(), redir_page.aslink())):
redir_page.delete(reason, prompt = False)
try:
redir_page.delete(reason, prompt = False)
except wikipedia.NoUsername:
if sd_template.has_key(targetPage.site().lang) and sd_tagging_sum.has_key(targetPage.site().lang):
wikipedia.output("No sysop in user-config.py, put page to speedy deletion.")
content = redir_page.get(get_redirect=True)
content = wikipedia.translate(targetPage.site().lang,sd_template)+"\n"+content
summary = wikipedia.translate(targetPage.site().lang,sd_tagging_sum)
redir_page.put(content, summary)
except wikipedia.IsRedirectPage: wikipedia.output( u'Redirect target %s is also a redirect! Won\'t delete anything.' % targetPage.aslink())
@@ -417,11 +440,13 @@ % targetPage.aslink())
content=targetPage.get(get_redirect=True)
if wikipedia.Page(wikipedia.getSite(), u"Template:Db-r1").exists():
if sd_template.has_key(targetPage.site().lang) and sd_tagging_sum.has_key(targetPage.site().lang): wikipedia.output(u"Tagging redirect for deletion") # Delete the two redirects
targetPage.put("{{db-r1}}\n"+content, "Tagging for speedy deletion")
redir.put("{{db-r1}}\n"+content, "Tagging for speedy deletion")
content = wikipedia.translate(targetPage.site().lang,sd_template)+"\n"+content
summary = wikipedia.translate(targetPage.site().lang,sd_tagging_sum)
targetPage.put(content, summary)
redir.put(content, summary) else: break # TODO Better implement loop redirect else:
Please, don't do this. The change on redirect.py was not a locale update, and I know it only because I had already read the bug ticket. Did you checked its behavior before committing it ?
Hopefully it seems to work, but please commit language updates and content changes separately...