Revision: 8425 Author: xqt Date: 2010-08-22 09:33:38 +0000 (Sun, 22 Aug 2010)
Log Message: ----------- update from trunk r8424
Modified Paths: -------------- branches/rewrite/scripts/cosmetic_changes.py branches/rewrite/scripts/interwiki.py branches/rewrite/scripts/redirect.py
Modified: branches/rewrite/scripts/cosmetic_changes.py =================================================================== --- branches/rewrite/scripts/cosmetic_changes.py 2010-08-22 08:38:42 UTC (rev 8424) +++ branches/rewrite/scripts/cosmetic_changes.py 2010-08-22 09:33:38 UTC (rev 8425) @@ -66,6 +66,7 @@ 'fa': u'ربات: زیباسازی', 'fi': u'Botti kosmeettisia muutoksia', 'fr': u'Robot : Changement de type cosmétique', + 'frr':u'Bot: Kosmeetisk feranerangen', 'fy': u'bot tekstwiziging', 'gl': u'bot Cambios estética', 'he': u'בוט: שינויים קוסמטיים', @@ -127,6 +128,7 @@ 'fa': u'; زیباسازی', 'fi': u'; kosmeettisia muutoksia', 'fr': u'; changement de type cosmétique', + 'frr':u'; kosmeetisk feranerangen', 'fy': u'; tekstwiziging', 'gl': u'; cambios estética', 'he': u'; שינויים קוסמטיים', @@ -237,6 +239,9 @@ """ Makes sure that localized namespace names are used. """ + # arz uses english stylish codes + if self.site.sitename() == 'wikipedia:arz': + return text family = self.site.family # wiki links aren't parsed here. exceptions = ['nowiki', 'comment', 'math', 'pre'] @@ -368,6 +373,7 @@ def resolveHtmlEntities(self, text): ignore = [ 38, # Ampersand (&) + 39, # Bugzilla 24093 60, # Less than (<) 62, # Great than (>) 91, # Opening bracket - sometimes used intentionally inside links @@ -376,8 +382,8 @@ 160, # Non-breaking space ( ) - not supported by Firefox textareas ] # ignore ' see http://eo.wikipedia.org/w/index.php?title=Liberec&diff=next&oldid=23... - if self.site.lang == 'eo': - ignore += [39] + #if self.site.lang == 'eo': + # ignore += [39] text = pywikibot.html2unicode(text, ignore = ignore) return text
@@ -471,6 +477,7 @@ self.generator = generator self.acceptall = acceptall self.comment = comment + self.done = False
def treat(self, page): try: @@ -479,11 +486,15 @@ pywikibot.output(u"\n\n>>> \03{lightpurple}%s\03{default} <<<" % page.title()) ccToolkit = CosmeticChangesToolkit(page.site, debug = True, namespace = page.namespace()) changedText = ccToolkit.change(page.get()) - if changedText != page.get(): + if changedText.strip() != page.get().strip(): if not self.acceptall: - choice = pywikibot.inputChoice(u'Do you want to accept these changes?', ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N') + choice = pywikibot.inputChoice(u'Do you want to accept these changes?', + ['Yes', 'No', 'All', 'Quit'], ['y', 'N', 'a', 'q'], 'N') if choice == 'a': self.acceptall = True + elif choice == 'q': + self.done = True + return if self.acceptall or choice == 'y': page.put(changedText, comment=self.comment) else: @@ -494,10 +505,13 @@ pywikibot.output("Page %s is a redirect; skipping." % page.aslink()) except pywikibot.LockedPage: pywikibot.output("Page %s is locked?!" % page.aslink()) + except pywikibot.EditConflict: + pywikibot.output("An edit conflict has occured at %s." % page.aslink())
def run(self): try: for page in self.generator: + if self.done: break self.treat(page) except KeyboardInterrupt: raise
Modified: branches/rewrite/scripts/interwiki.py =================================================================== --- branches/rewrite/scripts/interwiki.py 2010-08-22 08:38:42 UTC (rev 8424) +++ branches/rewrite/scripts/interwiki.py 2010-08-22 09:33:38 UTC (rev 8425) @@ -431,6 +431,7 @@ 'fo': (u'bottur ', u'leggur aftrat', u'strikar', u'broytur'), 'fr': (u'robot ', u'Ajoute', u'Retire', u'Modifie'), 'frp': (u'robot ', u'Apond', u'Retire', u'Modifie'), + 'frr': (u'Bot:', u'Diartudu', u'Wechnem', u'Feranere'), 'fur': (u'Robot: ', u'o zonti', u'o cambii', u'o gjavi'), 'fy': (u'Bot ', u'- derby', u'- fuort', u'- oars'), 'ga': (u'róbat ', u'ag suimiú', u'ag baint', u'ag mionathrú'),
Modified: branches/rewrite/scripts/redirect.py =================================================================== --- branches/rewrite/scripts/redirect.py 2010-08-22 08:38:42 UTC (rev 8424) +++ branches/rewrite/scripts/redirect.py 2010-08-22 09:33:38 UTC (rev 8425) @@ -73,6 +73,7 @@ 'fa': u'ربات:اصلاح تغییر مسیر دوتایی → %s', 'fi': u'Botti korjasi kaksinkertaisen ohjauksen → %s', 'fr': u'Robot: répare double redirection à %s', + 'frr':u'Bot: Ferbeedre dobelt widjerfeerang tu %s', 'ga': u'Róbó: Ag socrú athsheolta dúbailte → %s', 'he': u'בוט: מתקן הפניה כפולה → %s', 'hr': u'Bot: Popravak dvostrukih preusmjeravanja → %s', @@ -120,6 +121,7 @@ 'fa': u'ربات: (بن بست) تغییرمسیر به صفحهای که وجود ندارد', 'fi': u'Botti: Ohjauksen kohdesivua ei ole olemassa', 'fr': u'Robot : Cible du redirect inexistante', + 'frr':u'Bot: Widjerfeerang tu en duad sidj.', 'ga': u'Róbó : Targaid athsheoladh ar iarraidh', 'he': u'בוט: יעד ההפניה אינו קיים', 'it': u'Bot: Il redirect indirizza ad una pagina inesistente', @@ -151,6 +153,7 @@ 'de': u'Bot: Weiterleitungsziel auf sich selbst', 'en': u'[[WP:CSD#G8|G8]]: [[Wikipedia:Redirect|Redirect]] target forms a redirect loop', 'fa': u'ربات: تغییر مسیر حلقهای', + 'frr':u'Bot: Widjerfeerang üüb ham salew', }
# Insert deletion template into page with a broken redirect
pywikipedia-svn@lists.wikimedia.org