Commit graph

102 commits

Author SHA1 Message Date
Laurent Bachelier
5f9641e201 Fix doctest syntax
This also had the power to crash newer pyflakes releases.
2013-07-04 00:14:44 +02:00
Romain Bignon
09b0ae72d4 implicitly convert unicode objects to str for form values 2013-04-01 17:24:20 +02:00
Laurent Bachelier
be3e19a203 try/except import are now handled by flake8 2.0+ / pyflakes 0.6+ 2013-03-19 19:10:20 +01:00
Laurent Bachelier
7094931c92 Easy spacing fixes, trailing stuff
Remove useless trailing \
Remove trailing spaces
Add missing empty lines

autopep8 -ir -j2 --select=E301,E302,E502,W291,W293,W391 .

Diff quickly checked.
2013-03-16 00:54:55 +01:00
Laurent Bachelier
5747a98541 Use Firefox ESR
This is a long-term support version (54 weeks), which is ideal for us.
2013-03-02 10:35:07 +01:00
Laurent Bachelier
99f8a03895 Cache the sucessful protocols
And avoid doing too many failed handshakes.
2013-02-11 14:45:28 +01:00
Laurent Bachelier
085c784691 Fall back on SSLv3 if TLSv1 fails
This is so dirty :(
2013-02-11 14:45:27 +01:00
Romain Bignon
69e4c77257 use recent firefox user agent 2013-02-10 02:17:54 +01:00
Romain Bignon
126b5be301 ability to set a ENCODING constant to BasePage which overrides the Browser's one 2013-02-05 20:22:44 +01:00
Romain Bignon
535d6efc47 more explicit error messages during common import errors 2013-01-14 21:28:47 +01:00
Laurent Bachelier
8bc80db331 Add global "insecure" option to skip SSL validation
closes #930
2013-01-10 09:38:17 +01:00
Romain Bignon
db6ee276fa ability to specify a parser to use on a page handler 2013-01-02 13:48:42 +01:00
Laurent Bachelier
b3d1a17eaa Remove double import
This was likely introduced by copy-pasting from another file.
See e825a7eac0.
2012-11-24 20:30:31 +01:00
Laurent Bachelier
541d080c9d Use flake8 if available instead of pyflakes
With flake8, we can check for more issues and ignore those who are not
real issues.

This allowed me to find genuine errors in:
- modules/boursorama/pages/account_history.py
- modules/ing/pages/login.py
- weboob/tools/application/qt/qt.py
I left one in weboob/tools/browser/browser.py for the time being.

Some PEP8 fixes on other files.
2012-11-24 19:46:34 +01:00
Romain Bignon
e825a7eac0 add a ssl timeout (temp fix) 2012-11-24 12:06:13 +01:00
Laurent Bachelier
3eba9a809b Allow multiple CERTHASH values in a module
Also fix typos and usage of reserved hash() function.
2012-11-10 18:22:30 +01:00
Florent
894784995a Add new exception BrowserForbidden 2012-11-10 13:23:00 +01:00
Romain Bignon
3ea8494e80 fix certificate check 2012-09-05 15:55:12 +02:00
Romain Bignon
56797a7d0c automagically check certificate fingerprint if CERTHASH class attribute is set 2012-09-01 13:36:30 +02:00
Florent
702b56d594 SSL workaround 2012-09-01 12:56:23 +02:00
Romain Bignon
8677d8b183 raise a BrowserIncorrectPassword exception when handling a 401 2012-07-22 21:12:51 +02:00
Romain Bignon
5a046f00a8 create weboob.tools.browser.BrowserPasswordExpired 2012-04-21 18:22:07 +02:00
Romain Bignon
7a619a78d0 StandardBrowser.openurl uses mechanize.Browser.openurl instead of openurl_novisit 2012-04-13 15:00:12 +02:00
Romain Bignon
06599f48bc add a default timeout to 10s on connections 2012-04-12 21:50:56 +02:00
Romain Bignon
7082571acf update code documentation 2012-04-01 17:41:20 +02:00
Romain Bignon
c6a141595c change way to describe fields of CapBaseObject, and lot of documentation 2012-03-26 14:35:54 +02:00
Romain Bignon
98968d50d1 use urlparse to parse proxy url 2012-03-14 19:44:46 +01:00
Laurent Bachelier
391783a8b6 Support gzipped responses 2012-03-09 01:35:51 +01:00
Romain Bignon
5b9b1bfa16 better browser exceptions handling
Are considered to BrowserHTTPNotFound 403 errors and BrowserStateError.
Also, during StandardBrowser.openurl(), do not retry if error is
BrowserStateError.
2012-02-15 23:56:14 +01:00
Romain Bignon
05026b2f18 check that url isn't an unicode string (closes #784) 2012-02-07 14:49:25 +01:00
Laurent Bachelier
1621f3c3c0 Allow more freedom in page regexps
If the user starts with ^ or ends with $, do not add them. This allows
using only $ or ^.
If it's not a string, don't do anything to it (it has to be a regexp, or
mimic one).
Use search() instead of match(). They are the same, except match implies ^.

This does not break any module, it only adds more possibilities.
2012-02-01 23:19:01 +01:00
Laurent Bachelier
03f65bb121 Try to separate saved responses by backend
closes #661
2012-02-01 23:04:04 +01:00
Romain Bignon
4edeba3d62 fix crash when there isn't any photos on a profile 2011-12-12 14:37:24 +01:00
Romain Bignon
3110a1cd5a this is the end of the 'oh my fucking god' error message 2011-12-03 13:30:27 +01:00
Florent
7a2b21f1b6 Add the nologin option to "submit"
Signed-off-by: Romain Bignon <romain@peerfuse.org>
2011-11-29 17:14:41 +01:00
Laurent Bachelier
478696379c Try to add an extension when saving responses 2011-09-26 12:55:57 +02:00
Romain Bignon
5337e53b49 split BaseBrowser into new class StandardBrowser which is usable without inheriting it 2011-09-23 09:59:12 +02:00
Romain Bignon
0767ee40aa call 'on_loaded' only if logged 2011-07-24 17:46:56 +02:00
Romain Bignon
abb9b3dfc3 enable http and mechanize debugs before calling home() 2011-07-16 11:49:14 +02:00
Romain Bignon
ba6f31dac8 move remove_html_tags function into weboob.tools.misc 2011-07-03 10:52:33 +02:00
Romain Bignon
cb90621100 retry location after login 2011-07-02 13:22:25 +02:00
Romain Bignon
cb1478f455 check exception attribute (closes #581) 2011-05-08 13:56:00 +02:00
Laurent Bachelier
05a6bb79e4 Also log redirects when saving responses and debugging (refs #398)
set_debug_responses is not needed as we already save the responses in a
better way.
2011-05-08 13:55:41 +02:00
Laurent Bachelier
8075d538f0 Better messages and return codes in applications
Use stderr and return codes >0 when it makes sense.
Loose return code conventions:
* 1 for generic errors
* 2 for user input errors
* 3 for remote errors (not found, etc.)
* 4 for not implemented
2011-05-04 00:44:43 +02:00
Laurent Bachelier
740e7f12d2 pastebin backend: Support login
Also add an option to Browser to avoid making useless requests.
2011-04-30 22:28:03 +02:00
Romain Bignon
fa37ef38e3 fix to remove fucking hack from feedparser >= 5.0 (closes #649) 2011-04-24 16:58:20 +02:00
Romain Bignon
923c2ffc84 remove dead code 2011-04-23 09:04:41 +02:00
Laurent Bachelier
2c6d5d4e70 Fix previous commit on domain checking of id2url
* the condition on empty self.DOMAIN didn't work
* it introduced a regression as subdomains were accepted by the old code
2011-04-22 10:37:30 +02:00
Laurent Bachelier
4d8030b8dd Add check_url decorator, remove check_domain
check_domain was not used anywhere and was bugged (the domain argument
was ignored in favor of self.DOMAIN).
The check_url decorator checks if the URL can be handled, if not it will
return None. The idea is to avoid making unnecessary requests.
2011-04-21 22:18:17 +02:00
Laurent Bachelier
619b97669d Enhance domain checking of url2id
* Do not check for the domain if it is empty in the Browser class
* Better check of the domain (actually parse the URL domain)
* Add docstring
2011-04-21 20:15:18 +02:00