Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.exceptions import BrowserIncorrectPassword as _BrowserIncorrectPassword
class BrowserIncorrectPassword(_BrowserIncorrectPassword):
pass
from weboob.exceptions import BrowserForbidden as _BrowserForbidden
class BrowserForbidden(_BrowserForbidden):
pass
from weboob.exceptions import BrowserBanned as _BrowserBanned
class BrowserBanned(_BrowserBanned):
pass
from weboob.exceptions import BrowserUnavailable as _BrowserUnavailable
class BrowserUnavailable(_BrowserUnavailable):
pass
from weboob.exceptions import BrowserInteraction as _BrowserInteraction
class BrowserInteraction(_BrowserInteraction):
pass
from weboob.exceptions import BrowserQuestion as _BrowserQuestion
class BrowserQuestion(_BrowserQuestion):
"""
When raised by a browser,
"""
def __init__(self, *fields):
self.fields = fields
class DecoupledValidation(BrowserInteraction):
def __init__(self, message='', resource=None, *values):
super(DecoupledValidation, self).__init__(*values)
self.message = message
self.resource = resource
def __str__(self):
return self.message
class AppValidation(DecoupledValidation):
pass
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
from weboob.exceptions import BrowserRedirect as _BrowserRedirect
class BrowserRedirect(_BrowserRedirect):
def __init__(self, url):
self.url = url
def __str__(self):
return 'Redirecting to %s' % self.url
from weboob.exceptions import CaptchaQuestion as _CaptchaQuestion
class CaptchaQuestion(_CaptchaQuestion):
"""Site requires solving a CAPTCHA (base class)"""
# could be improved to pass the name of the backendconfig key
def __init__(self, type=None, **kwargs):
super(CaptchaQuestion, self).__init__("The site requires solving a captcha")
self.type = type
for key, value in kwargs.items():
setattr(self, key, value)
class WrongCaptchaResponse(Exception):
"""when website tell us captcha response is not good"""
def __init__(self, message=None):
super(WrongCaptchaResponse, self).__init__(message or "Captcha response is wrong")
from weboob.exceptions import ImageCaptchaQuestion as _ImageCaptchaQuestion
class ImageCaptchaQuestion(_ImageCaptchaQuestion):
type = 'image_captcha'
image_data = None
def __init__(self, image_data):
super(ImageCaptchaQuestion, self).__init__(self.type, image_data=image_data)
from weboob.exceptions import NocaptchaQuestion as _NocaptchaQuestion
class NocaptchaQuestion(_NocaptchaQuestion):
type = 'g_recaptcha'
website_key = None
website_url = None
def __init__(self, website_key, website_url):
super(NocaptchaQuestion, self).__init__(self.type, website_key=website_key, website_url=website_url)
from weboob.exceptions import RecaptchaQuestion as _RecaptchaQuestion
class RecaptchaQuestion(_RecaptchaQuestion):
type = 'g_recaptcha'
website_key = None
website_url = None
def __init__(self, website_key, website_url):
super(RecaptchaQuestion, self).__init__(self.type, website_key=website_key, website_url=website_url)
class RecaptchaV3Question(CaptchaQuestion):
type = 'g_recaptcha'
website_key = None
website_url = None
action = None
def __init__(self, website_key, website_url, action=None):
super(RecaptchaV3Question, self).__init__(self.type, website_key=website_key, website_url=website_url)
self.action = action
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
from weboob.exceptions import FuncaptchaQuestion as _FuncaptchaQuestion
class FuncaptchaQuestion(_FuncaptchaQuestion):
type = 'funcaptcha'
website_key = None
website_url = None
sub_domain = None
def __init__(self, website_key, website_url, sub_domain=None):
super(FuncaptchaQuestion, self).__init__(
self.type, website_key=website_key, website_url=website_url, sub_domain=sub_domain)
from weboob.exceptions import BrowserHTTPNotFound as _BrowserHTTPNotFound
class BrowserHTTPNotFound(_BrowserHTTPNotFound):
pass
from weboob.exceptions import BrowserHTTPError as _BrowserHTTPError
class BrowserHTTPError(_BrowserHTTPError):
pass
from weboob.exceptions import BrowserHTTPSDowngrade as _BrowserHTTPSDowngrade
class BrowserHTTPSDowngrade(_BrowserHTTPSDowngrade):
pass
from weboob.exceptions import BrowserSSLError as _BrowserSSLError
class BrowserSSLError(_BrowserSSLError):
pass
from weboob.exceptions import ParseError as _ParseError
class ParseError(_ParseError):
pass
from weboob.exceptions import FormFieldConversionWarning as _FormFieldConversionWarning
class FormFieldConversionWarning(_FormFieldConversionWarning):
"""
A value has been set to a form's field and has been implicitly converted.
"""
from weboob.exceptions import NoAccountsException as _NoAccountsException
class NoAccountsException(_NoAccountsException):
pass
from weboob.exceptions import ModuleInstallError as _ModuleInstallError
class ModuleInstallError(_ModuleInstallError):
pass
from weboob.exceptions import ModuleLoadError as _ModuleLoadError
class ModuleLoadError(_ModuleLoadError):
def __init__(self, module_name, msg):
super(ModuleLoadError, self).__init__(msg)
self.module = module_name
from weboob.exceptions import ActionNeeded as _ActionNeeded
class ActionNeeded(_ActionNeeded):
pass
from weboob.exceptions import AuthMethodNotImplemented as _AuthMethodNotImplemented
class AuthMethodNotImplemented(_AuthMethodNotImplemented):
pass
from weboob.exceptions import BrowserPasswordExpired as _BrowserPasswordExpired
class BrowserPasswordExpired(_BrowserPasswordExpired):
pass