jenkins-bot has submitted this change and it was merged.
Change subject: String improvements ......................................................................
String improvements
- use ascii_letters from string - "D" is a roman number character too
Change-Id: I8e22bc009aef49d8ee68d55a0d62c08a59ac2062 --- M scripts/casechecker.py 1 file changed, 9 insertions(+), 9 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/casechecker.py b/scripts/casechecker.py index d1858de..06ee014 100755 --- a/scripts/casechecker.py +++ b/scripts/casechecker.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """Bot to find all pages on the wiki with mixed latin and cyrilic alphabets.""" # -# (C) Pywikibot team, 2006-2014 +# (C) Pywikibot team, 2006-2015 # # Distributed under the terms of the MIT license. # @@ -12,6 +12,7 @@ import codecs import os import re +from string import ascii_letters import sys
import pywikibot @@ -107,7 +108,7 @@ localKeyboard = u'йцукенгшщзфывапролдячсмить' latinKeyboard = u'qwertyuiopasdfghjklzxcvbnm'
- romanNumChars = u'IVXLMC' + romanNumChars = u'IVXLCDM' # all letters that may be used as suffixes after roman numbers: "Iый" romannumSuffixes = localLowerLtr romanNumSfxPtrn = re.compile( @@ -116,8 +117,6 @@ whitelists = { 'ru': u'ВП:КЛ/Проверенные', } - - latLtr = u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
lclClrFnt = u'<font color=green>' latClrFnt = u'<font color=brown>' @@ -249,10 +248,11 @@ self.latToLclKeybDict = {}
badPtrnStr = u'([%s][%s]|[%s][%s])' \ - % (self.latLtr, self.localLtr, self.localLtr, self.latLtr) + % (ascii_letters, self.localLtr, + self.localLtr, ascii_letters) self.badWordPtrn = re.compile(u'[%s%s]*%s[%s%s]*' - % (self.latLtr, self.localLtr, - badPtrnStr, self.latLtr, + % (ascii_letters, self.localLtr, + badPtrnStr, ascii_letters, self.localLtr))
# Get whitelist @@ -539,7 +539,7 @@ else: if mightBeLcl and l not in self.latinSuspects: mightBeLcl = False - if l not in self.latLtr: + if l not in ascii_letters: raise ValueError(u'Assert failed')
# Some words are well known and frequently mixed-typed @@ -703,7 +703,7 @@ else: res += self.suffixClr + self.lclClrFnt lastIsCyr = True - elif l in self.latLtr: + elif l in ascii_letters: if lastIsCyr: if toScreen: SetColor(FOREGROUND_RED)
pywikibot-commits@lists.wikimedia.org