jenkins-bot has submitted this change and it was merged.

Change subject: remove UI.askForCaptcha
......................................................................


remove UI.askForCaptcha

Terminal's UI.askForCaptcha is used in compat, but unused in core.
it is removed as unused.

Bug: T122194
Change-Id: If11306342286ce04ec916455fa6dcb71572c229b
---
M pywikibot/bot.py
M pywikibot/userinterfaces/terminal_interface_base.py
2 files changed, 1 insertion(+), 22 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 80905bf..18436db 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -162,7 +162,7 @@
 # level name.
 #
 # UserInterface objects must also define methods input(), input_choice(),
-# editText(), and askForCaptcha(), all of which are documented in
+# and editText(), all of which are documented in
 # userinterfaces/terminal_interface.py
 
 _handlers_initialized = False
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py 
b/pywikibot/userinterfaces/terminal_interface_base.py
index 81fd1dd..2fbe1a8 100755
--- a/pywikibot/userinterfaces/terminal_interface_base.py
+++ b/pywikibot/userinterfaces/terminal_interface_base.py
@@ -433,27 +433,6 @@
         editor = gui.EditBoxWindow()
         return editor.edit(text, jumpIndex=jumpIndex, highlight=highlight)
 
-    def askForCaptcha(self, url):
-        """Show the user a CAPTCHA image and return the answer."""
-        try:
-            import webbrowser
-            pywikibot.output(u'Opening CAPTCHA in your web browser...')
-            if webbrowser.open(url):
-                return pywikibot.input(
-                    u'What is the solution of the CAPTCHA that is shown in '
-                    u'your web browser?')
-            else:
-                raise webbrowser.Error(
-                    'webbrowser.open failed to open a web browser')
-        except Exception:
-            pywikibot.output(u'Error in opening web browser: %s'
-                             % sys.exc_info()[0])
-            pywikibot.output(
-                u'Please copy this url to your web browser and open it:\n %s'
-                % url)
-            return pywikibot.input(
-                u'What is the solution of the CAPTCHA at this url ?')
-
     def argvu(self):
         """Return the decoded arguments from argv."""
         try:

-- 
To view, visit https://gerrit.wikimedia.org/r/266083
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If11306342286ce04ec916455fa6dcb71572c229b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to