Xqt added a comment.

  Deactivated code due to T57185 <https://phabricator.wikimedia.org/T57185>
  
    # valid digits
    digits = {
        'ckb': ('٠١٢٣٤٥٦٧٨٩', 'fa'),
        'fa': ('۰۱۲۳۴۵۶۷۸۹', 'ckb'),
    }
    
    # For replacing old digits by new one
    new, old_key = digits[self.site.code]
    old = digits[old_key][0]
    
    # FIXME: split this function into two.
    # replace persian/arabic digits
    # deactivated due to bug T57185
    for i in range(0, 10):
        text = textlib.replaceExcept(text, old[i], new[i], exceptions)
    # do not change digits in class, style and table params
    pattern = re.compile(r'\w+=(".+?"|\d+)', re.UNICODE)
    exceptions.append(pattern)
    # do not change digits inside html-tags
    pattern = re.compile('<[/]*?[^</]+?[/]*?>', re.UNICODE)
    exceptions.append(pattern)
    exceptions.append('table')  # exclude tables for now
    # replace digits
    for i in range(0, 10):
        text = textlib.replaceExcept(text, str(i), new[i], exceptions)
    return text

TASK DETAIL
  https://phabricator.wikimedia.org/T57185

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Xqt
Cc: Cyberpower678, gerritbot, jayvdb, Aklapper, Xqt, Legoktm, 
pywikibot-bugs-list, Ladsgroup, JohnsonLee01, SHEKH, Dijkstra, Khutuck, 
Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to