http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10124
Revision: 10124 Author: xqt Date: 2012-04-17 09:48:07 +0000 (Tue, 17 Apr 2012) Log Message: ----------- messages must be changed
Modified Paths: -------------- branches/rewrite/scripts/redirect.py trunk/pywikipedia/redirect.py
Modified: branches/rewrite/scripts/redirect.py =================================================================== --- branches/rewrite/scripts/redirect.py 2012-04-17 07:55:56 UTC (rev 10123) +++ branches/rewrite/scripts/redirect.py 2012-04-17 09:48:07 UTC (rev 10124) @@ -552,11 +552,11 @@ ## # Delete the two redirects ## content = i18n.twtranslate( ## targetPage.site.lang, -## 'redirect-remove-loop', +## 'redirect-broken-redirect-template' ## ) + "\n" + content ## summ = i18n.twtranslate( ## targetPage.site.lang, -## 'redirect-broken-redirect-template') +## 'redirect-remove-loop') ## targetPage.put(content, summ) ## redir.put(content, summ) ## break # TODO Better implement loop redirect
Modified: trunk/pywikipedia/redirect.py =================================================================== --- trunk/pywikipedia/redirect.py 2012-04-17 07:55:56 UTC (rev 10123) +++ trunk/pywikipedia/redirect.py 2012-04-17 09:48:07 UTC (rev 10124) @@ -396,7 +396,7 @@ def get_moved_pages_redirects_old(self):
move_regex = re.compile( - r'moved <a href.*?>(.*?)</a> to <a href=.*?>.*?</a>.*?</li>') + r'moved <a href.*?>(.*?)</a> to <a href=.*?>.*?</a>.*?</li>')
if self.offset <= 0: self.offset = 1 @@ -410,8 +410,8 @@ offset_time = start.strftime("%Y%m%d%H%M%S") while True: move_url = \ - self.site.path() + "?title=Special:Log&limit=500&offset=%s&type=move"\ - % offset_time +"%(path)s?title=Special:Log&limit=500&offset=%(offset)s&type=move&uselang=en" \ + % {'path': self.site.path(), 'offset': offset_time} try: move_list = self.site.getUrl(move_url) if pywikibot.verbose: @@ -632,11 +632,11 @@ ## # Delete the two redirects ## content = i18n.translate( ## targetPage.site().lang, -## 'redirect-remove-loop', +## 'redirect-broken-redirect-template' ## ) + "\n" + content ## summ = i18n.translate( ## targetPage.site().lang, -## 'redirect-broken-redirect-template') +## 'redirect-remove-loop') ## targetPage.put(content, summ) ## redir.put(content, summ) ## break # TODO Better implement loop redirect @@ -781,6 +781,8 @@ number = int(arg[7:]) # old param, use -total instead elif arg.startswith('-number:'): + pywikibot.output(u'\nNOTE: -number option is deprecated.' + u' Use -total instead') number = int(arg[8:]) elif arg == '-always': always = True
pywikipedia-svn@lists.wikimedia.org