jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1164987?usp=email )
Change subject: [IMPR] Fix import location ......................................................................
[IMPR] Fix import location
textlib.NON_LATIN_DIGITS was moved to pywikibot.userinterfaces.transliteration years ago
Change-Id: I64abda69ef780ba9b7b5e6a6cd994a7ba81bef5b --- M pywikibot/cosmetic_changes.py M pywikibot/date.py 2 files changed, 7 insertions(+), 11 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py index 55ea751..b78b8fe 100644 --- a/pywikibot/cosmetic_changes.py +++ b/pywikibot/cosmetic_changes.py @@ -66,13 +66,9 @@ from pywikibot import exceptions, i18n, textlib from pywikibot.backports import Callable, Match, Pattern from pywikibot.site import Namespace -from pywikibot.textlib import ( - FILE_LINK_REGEX, - MultiTemplateMatchBuilder, - get_regexes, -) from pywikibot.tools import first_lower, first_upper from pywikibot.tools.chars import url2string +from pywikibot.userinterfaces.transliteration import NON_LATIN_DIGITS
try: @@ -525,7 +521,7 @@ cache: dict[bool | str, Any] = {} exceptions = ['comment', 'nowiki', 'pre', 'syntaxhighlight'] regex = re.compile( - FILE_LINK_REGEX % '|'.join(self.site.namespaces[6]), + textlib.FILE_LINK_REGEX % '|'.join(self.site.namespaces[6]), flags=re.VERBOSE) return textlib.replaceExcept( text, regex, replace_magicword, exceptions) @@ -711,7 +707,7 @@ return text
skippings = ['comment', 'category'] - skip_regexes = get_regexes(skippings, self.site) + skip_regexes = textlib.get_regexes(skippings, self.site) # site defined templates skip_templates = { 'cs': ('Pahýl[ _]část',), # stub section @@ -819,7 +815,7 @@ def replaceDeprecatedTemplates(self, text: str) -> str: """Replace deprecated templates.""" exceptions = ['comment', 'math', 'nowiki', 'pre'] - builder = MultiTemplateMatchBuilder(self.site) + builder = textlib.MultiTemplateMatchBuilder(self.site)
if self.site.family.name in deprecatedTemplates \ and self.site.code in deprecatedTemplates[self.site.family.name]: @@ -1035,8 +1031,8 @@ 'syntaxhighlight', ]
- digits = textlib.NON_LATIN_DIGITS - faChrs = 'ءاآأإئؤبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهیةيك' + digits['fa'] + digits = NON_LATIN_DIGITS['fa'] + faChrs = 'ءاآأإئؤبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهیةيك' + digits
# not to let bot edits in latin content exceptions.append(re.compile(f'[^{faChrs}] *?"*? *?, *?[^{faChrs}]')) diff --git a/pywikibot/date.py b/pywikibot/date.py index 237afac..e6b4eae 100644 --- a/pywikibot/date.py +++ b/pywikibot/date.py @@ -25,8 +25,8 @@ Sequence, ) from pywikibot.site import BaseSite -from pywikibot.textlib import NON_LATIN_DIGITS from pywikibot.tools import deprecate_arg, first_lower, first_upper +from pywikibot.userinterfaces.transliteration import NON_LATIN_DIGITS
if TYPE_CHECKING:
pywikibot-commits@lists.wikimedia.org