Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/127626
Change subject: flake: remove obsolete disambigText assignment ...................................................................... flake: remove obsolete disambigText assignment minor sync updates from compat Change-Id: Ifb41ad87c71f9a231316249afc628f355e75acea --- M scripts/solve_disambiguation.py 1 file changed, 12 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/26/127626/1 diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py index be176cc..d465083 100644 --- a/scripts/solve_disambiguation.py +++ b/scripts/solve_disambiguation.py @@ -648,7 +648,8 @@ if not self.always: # at the beginning of the link, start red color. # at the end of the link, reset the color to default - pywikibot.output(text[max(0, m.start() - context):m.start()] + pywikibot.output(text[max(0, m.start() - context): + m.start()] + '\03{lightred}' + text[m.start():m.end()] + '\03{default}' @@ -686,7 +687,7 @@ jumpIndex=m.start(), highlight=disambredir.title()) else: - disambigText = editor.edit( + editor.edit( disambPage.get(), jumpIndex=m.start(), highlight=disambPage.title()) @@ -706,7 +707,8 @@ elif choice in ['n', 'N']: # skip this page if self.primary: - # If run with the -primary argument, skip this occurence next time. + # If run with the -primary argument, skip this + # occurence next time. self.primaryIgnoreManager.ignore(refPage) return True elif choice in ['q', 'Q']: @@ -737,9 +739,10 @@ link_text += trailing_chars # '?', '/' for old choice if choice in ['t', 'T', '?', '/']: - #small chunk of text to search + # small chunk of text to search search_text = text[m.end():m.end() + context] - #figure out where the link (and sentance) ends, put note there + # figure out where the link (and sentance) ends, put note + # there end_of_word_match = re.search("\s", search_text) if end_of_word_match: position_split = end_of_word_match.start(0) @@ -776,8 +779,8 @@ continue if choice >= len(self.alternatives) or choice < 0: pywikibot.output( -u"Choice out of range. Please select a number between 0 and %i." - % (len(self.alternatives) - 1)) + u"Choice out of range. Please select a number " + u"between 0 and %i." % (len(self.alternatives) - 1)) # show list of possible choices self.listAlternatives() # step back to ask the user again what to do with the @@ -843,7 +846,8 @@ and self.primary_redir_template[disambPage.site.lang] in disambPage.templates(get_redirect=True)): baseTerm = disambPage.title() - for template in disambPage.templatesWithParams(get_redirect=True): + for template in disambPage.templatesWithParams( + get_redirect=True): if template[0] == self.primary_redir_template[ disambPage.site.lang] \ and len(template[1]) > 0: -- To view, visit https://gerrit.wikimedia.org/r/127626 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifb41ad87c71f9a231316249afc628f355e75acea Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt <i...@gno.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits