The new woob repository is here: This gitlab will be removed soon.

Commit e1535b69 authored by Romain Bignon's avatar Romain Bignon

captcha: little coding style improvement

parent f19f9d48
......@@ -133,7 +133,7 @@ def do_login(self):
if not has_captcha:
raise BrowserIncorrectPassword()
raise CaptchaQuestion(image_url=has_captcha, type="image_captcha")
raise CaptchaQuestion('image_captcha', image_url=has_captcha)
def location(self, *args, **kwargs):
......@@ -67,7 +67,7 @@ def do_login(self):
website_key = # google recaptcha plubic key
website_url = ""
raise CaptchaQuestion(website_key=website_key, website_url=website_url, type="g_recaptcha")
raise CaptchaQuestion('g_recaptcha', website_key=website_key, website_url=website_url)
raise BrowserIncorrectPassword()
......@@ -46,12 +46,11 @@ class CaptchaQuestion(Exception):
Handles captcha
def __init__(self, website_key=None, website_url=None, image_url=None, type=None):
def __init__(self, type=None, **kwargs):
super(CaptchaQuestion, self).__init__("The site requires solving a captcha")
self.website_key = website_key
self.website_url = website_url
self.type = type
self.image_url = image_url
for key, value in kwargs.items():
setattr(self, key, value)
class BrowserHTTPNotFound(BrowserUnavailable):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment