Commit 0088013a authored by Florent Fourcot's avatar Florent Fourcot

Rename BaseBrowser to Browser

parent 444d36ee
......@@ -65,7 +65,7 @@ In a module directory, there are commonly these files:
* **__init__.py** - needed in every python modules, it exports your :class:`Module <weboob.tools.backend.Module>` class.
* **module.py** - defines the main class of your module, which derives :class:`Module <weboob.tools.backend.Module>`.
* **browser.py** - your browser, derived from :class:`BaseBrowser <weboob.tools.browser2.browser.BaseBrowser>`, is called by your module to interact with the supported website.
* **browser.py** - your browser, derived from :class:`Browser <weboob.tools.browser2.browser.Browser>`, is called by your module to interact with the supported website.
* **pages.py** - all website's pages handled by the browser are defined here
* **test.py** - functional tests
* **favicon.png** - a 64x64 transparent PNG icon
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserHTTPNotFound
from weboob.tools.browser import Browser, BrowserHTTPNotFound
from .pages import RecipePage, ResultsPage
......@@ -26,11 +26,11 @@ from .pages import RecipePage, ResultsPage
__all__ = ['SevenFiftyGramsBrowser']
class SevenFiftyGramsBrowser(BaseBrowser):
class SevenFiftyGramsBrowser(Browser):
DOMAIN = 'www.750g.com'
PROTOCOL = 'http'
ENCODING = 'windows-1252'
USER_AGENT = BaseBrowser.USER_AGENTS['wget']
USER_AGENT = Browser.USER_AGENTS['wget']
PAGES = {
'http://www.750g.com/recettes_.*.htm': ResultsPage,
'http://www.750g.com/fiche_de_cuisine_complete.htm\?recettes_id=[0-9]*': RecipePage,
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser.decorators import id2url
from weboob.tools.browser import BaseBrowser
from weboob.tools.browser import Browser
from .job import AdeccoJobAdvert
from .pages import SearchPage, AdvertPage
import urllib
......@@ -26,7 +26,7 @@ import urllib
__all__ = ['AdeccoBrowser']
class AdeccoBrowser(BaseBrowser):
class AdeccoBrowser(Browser):
PROTOCOL = 'http'
DOMAIN = 'www.adecco.fr'
ENCODING = None
......
......@@ -20,7 +20,7 @@
from weboob.capabilities.base import NotAvailable, NotLoaded
from weboob.capabilities.cinema import Movie, Person
from weboob.tools.browser import BaseBrowser
from weboob.tools.browser import Browser
from weboob.tools.json import json
import base64
import hashlib
......@@ -32,7 +32,7 @@ import urllib
__all__ = ['AllocineBrowser']
class AllocineBrowser(BaseBrowser):
class AllocineBrowser(Browser):
DOMAIN = 'api.allocine.fr'
PROTOCOL = 'http'
ENCODING = 'utf-8'
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserHTTPNotFound
from weboob.tools.browser import Browser, BrowserHTTPNotFound
from .pages import RecipePage, ResultsPage, FourOFourPage
......@@ -26,11 +26,11 @@ from .pages import RecipePage, ResultsPage, FourOFourPage
__all__ = ['AllrecipesBrowser']
class AllrecipesBrowser(BaseBrowser):
class AllrecipesBrowser(Browser):
DOMAIN = 'allrecipes.com'
PROTOCOL = 'http'
ENCODING = 'utf-8'
USER_AGENT = BaseBrowser.USER_AGENTS['wget']
USER_AGENT = Browser.USER_AGENTS['wget']
PAGES = {
'http://allrecipes.com/search/default.aspx\?qt=k&wt=.*&rt=r&origin=.*': ResultsPage,
'http://allrecipes.com/Recipe/.*/Detail.aspx': RecipePage,
......
......@@ -17,7 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from weboob.capabilities.bill import Detail
from decimal import Decimal
from .pages import LoginPage, HomePage, AccountPage, LastPaymentsPage, PaymentDetailsPage, BillsPage
......@@ -25,7 +25,7 @@ from .pages import LoginPage, HomePage, AccountPage, LastPaymentsPage, PaymentDe
__all__ = ['AmeliBrowser']
class AmeliBrowser(BaseBrowser):
class AmeliBrowser(Browser):
PROTOCOL = 'https'
DOMAIN = 'assure.ameli.fr'
ENCODING = None
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
import urllib
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from weboob.capabilities.bill import Detail
from decimal import Decimal
from .pages import LoginPage, HomePage, AccountPage, HistoryPage, BillsPage
......@@ -26,7 +26,7 @@ from .pages import LoginPage, HomePage, AccountPage, HistoryPage, BillsPage
__all__ = ['AmeliProBrowser']
class AmeliProBrowser(BaseBrowser):
class AmeliProBrowser(Browser):
PROTOCOL = 'https'
DOMAIN = 'espacepro.ameli.fr'
ENCODING = None
......
......@@ -20,7 +20,7 @@
from urlparse import urlsplit, parse_qsl
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from .pages import LoginPage, AccountsPage, TransactionsPage
......@@ -28,7 +28,7 @@ from .pages import LoginPage, AccountsPage, TransactionsPage
__all__ = ['AmericanExpressBrowser']
class AmericanExpressBrowser(BaseBrowser):
class AmericanExpressBrowser(Browser):
DOMAIN = 'global.americanexpress.com'
PROTOCOL = 'https'
ENCODING = 'ISO-8859-1'
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser.decorators import id2url
from weboob.tools.browser import BaseBrowser
from weboob.tools.browser import Browser
import urllib
from .pages import SearchPage, AdvertPage
from .job import ApecJobAdvert
......@@ -27,7 +27,7 @@ from .job import ApecJobAdvert
__all__ = ['ApecBrowser']
class ApecBrowser(BaseBrowser):
class ApecBrowser(Browser):
PROTOCOL = 'http'
DOMAIN = 'www.apec.fr'
ENCODING = 'ISO-8859-1'
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from .pages import LoginPage, AccountsPage, OperationsPage
......@@ -26,7 +26,7 @@ from .pages import LoginPage, AccountsPage, OperationsPage
__all__ = ['ApivieBrowser']
class ApivieBrowser(BaseBrowser):
class ApivieBrowser(Browser):
PROTOCOL = 'https'
DOMAIN = 'www.apivie.fr'
ENCODING = None
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from weboob.tools.browser.decorators import id2url
from .pages import VideoPage, IndexPage, LoginPage, LoginRedirectPage
......@@ -28,7 +28,7 @@ from .video import ArretSurImagesVideo
__all__ = ['ArretSurImagesBrowser']
class ArretSurImagesBrowser(BaseBrowser):
class ArretSurImagesBrowser(Browser):
PROTOCOL = 'http'
DOMAIN = 'www.arretsurimages.net'
ENCODING = None
......
......@@ -25,7 +25,7 @@ import urllib
from weboob.capabilities import NotAvailable
from weboob.capabilities.image import BaseImage
from weboob.tools.json import json as simplejson
from weboob.tools.browser import BaseBrowser
from weboob.tools.browser import Browser
from weboob.tools.browser.decorators import id2url
from .pages import ArteLivePage, ArteLiveVideoPage
......@@ -34,7 +34,7 @@ from .video import ArteVideo, ArteLiveVideo
__all__ = ['ArteBrowser']
class ArteBrowser(BaseBrowser):
class ArteBrowser(Browser):
DOMAIN = u'videos.arte.tv'
ENCODING = None
PAGES = {r'http://concert.arte.tv/\w+': ArteLivePage,
......@@ -51,7 +51,7 @@ class ArteBrowser(BaseBrowser):
self.lang = lang
self.quality = quality
self.order = order
BaseBrowser.__init__(self, *args, **kwargs)
Browser.__init__(self, *args, **kwargs)
@id2url(ArteVideo.id2url)
def get_video(self, url, video=None):
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserHTTPNotFound
from weboob.tools.browser import Browser, BrowserHTTPNotFound
from .pages import SubtitlesPage, SearchPage
......@@ -26,11 +26,11 @@ from .pages import SubtitlesPage, SearchPage
__all__ = ['AttilasubBrowser']
class AttilasubBrowser(BaseBrowser):
class AttilasubBrowser(Browser):
DOMAIN = 'davidbillemont3.free.fr'
PROTOCOL = 'http'
ENCODING = 'windows-1252'
USER_AGENT = BaseBrowser.USER_AGENTS['wget']
USER_AGENT = Browser.USER_AGENTS['wget']
PAGES = {
'http://search.freefind.com/find.html.*': SearchPage,
'http://davidbillemont3.free.fr/.*.htm': SubtitlesPage,
......
......@@ -26,7 +26,7 @@ import re
import urllib
import urllib2
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword, BrowserHTTPNotFound, BrowserUnavailable
from weboob.tools.browser import Browser, BrowserIncorrectPassword, BrowserHTTPNotFound, BrowserUnavailable
from weboob.tools.json import json
from weboob.tools.date import local2utc
from weboob.tools.misc import to_unicode
......@@ -66,7 +66,7 @@ class AuMException(UserError):
self.code = code
class WebsiteBrowser(BaseBrowser):
class WebsiteBrowser(Browser):
def login(self):
data = {'username': self.username,
'password': self.password,
......@@ -115,7 +115,7 @@ class WebsiteBrowser(BaseBrowser):
return profile
class AuMBrowser(BaseBrowser):
class AuMBrowser(Browser):
DOMAIN = 'www.adopteunmec.com'
APIKEY = 'fb0123456789abcd'
APITOKEN = 'DCh7Se53v8ejS8466dQe63'
......@@ -131,7 +131,7 @@ class AuMBrowser(BaseBrowser):
def __init__(self, username, password, search_query, *args, **kwargs):
kwargs['get_home'] = False
BaseBrowser.__init__(self, username, password, *args, **kwargs)
Browser.__init__(self, username, password, *args, **kwargs)
# now we do authentication ourselves
#self.add_password('http://www.adopteunmec.com/api/', self.username, self.password)
......@@ -239,7 +239,7 @@ class AuMBrowser(BaseBrowser):
if e.getcode() in (410,):
return BrowserHTTPNotFound
return BaseBrowser.get_exception(self, e)
return Browser.get_exception(self, e)
def home(self):
r = self.api_request('home/')
......
......@@ -20,7 +20,7 @@
import urllib
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from .pages import LoginPage, AccountsPage, TransactionsPage, CBTransactionsPage, UnavailablePage
......@@ -28,7 +28,7 @@ from .pages import LoginPage, AccountsPage, TransactionsPage, CBTransactionsPage
__all__ = ['AXABanque']
class AXABanque(BaseBrowser):
class AXABanque(Browser):
PROTOCOL = 'https'
DOMAIN = 'www.axabanque.fr'
PAGES = {'https?://www.axabanque.fr/connexion/index.html.*': LoginPage,
......
......@@ -20,7 +20,7 @@
import urllib
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword, BrokenPageError
from weboob.tools.browser import Browser, BrowserIncorrectPassword, BrokenPageError
from .pages import LoginPage, IndexPage, AccountsPage, CardsPage, TransactionsPage, \
UnavailablePage, RedirectPage, HomePage
......@@ -29,7 +29,7 @@ from .pages import LoginPage, IndexPage, AccountsPage, CardsPage, TransactionsPa
__all__ = ['BanquePopulaire']
class BanquePopulaire(BaseBrowser):
class BanquePopulaire(Browser):
PROTOCOL = 'https'
ENCODING = 'iso-8859-15'
PAGES = {'https://[^/]+/auth/UI/Login.*': LoginPage,
......@@ -55,7 +55,7 @@ class BanquePopulaire(BaseBrowser):
self.DOMAIN = website
self.token = None
BaseBrowser.__init__(self, *args, **kwargs)
Browser.__init__(self, *args, **kwargs)
def is_logged(self):
return not self.is_on_page(LoginPage)
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from .pages import LoginPage, Login2Page, IndexPage, AccountsPage, TransactionsPage, \
CardPage, ValuationPage, LoanPage, MarketPage
......@@ -27,7 +27,7 @@ from .pages import LoginPage, Login2Page, IndexPage, AccountsPage, TransactionsP
__all__ = ['Barclays']
class Barclays(BaseBrowser):
class Barclays(Browser):
PROTOCOL = 'https'
DOMAIN = 'www.barclays.fr'
PAGES = {'https?://.*.barclays.fr/\d-index.html': IndexPage,
......@@ -44,7 +44,7 @@ class Barclays(BaseBrowser):
def __init__(self, secret, *args, **kwargs):
self.secret = secret
BaseBrowser.__init__(self, *args, **kwargs)
Browser.__init__(self, *args, **kwargs)
def is_logged(self):
return self.page is not None and not self.is_on_page((LoginPage, IndexPage, Login2Page))
......
......@@ -22,7 +22,7 @@ import urllib
from datetime import datetime
from logging import warning
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword, BrowserPasswordExpired
from weboob.tools.browser import Browser, BrowserIncorrectPassword, BrowserPasswordExpired
from weboob.capabilities.bank import TransferError, Transfer
from .perso.accounts_list import AccountsList, AccountPrelevement
......@@ -36,7 +36,7 @@ from .pro import ProAccountsList, ProAccountHistory
__all__ = ['BNPorc']
class BNPorc(BaseBrowser):
class BNPorc(Browser):
DOMAIN = 'www.secure.bnpparibas.net'
PROTOCOL = 'https'
CERTHASH = ['5511f0ff19c982b6351c17b901bfa7419f075edb13f2df41e446248beb7866bb', 'fa8cb72ef2e46054469af916f7ec222b1904901fecde8511a0f769ba0385410d', '86cd4ba8cfbc53937dfc402e8c2d0a2d5ffb630a73bbeafd09c39f8b54a6a6c3']
......@@ -66,7 +66,7 @@ class BNPorc(BaseBrowser):
def __init__(self, *args, **kwargs):
self.rotating_password = kwargs.pop('rotating_password', None)
self.password_changed_cb = kwargs.pop('password_changed_cb', None)
BaseBrowser.__init__(self, *args, **kwargs)
Browser.__init__(self, *args, **kwargs)
def home(self):
self.location('https://www.secure.bnpparibas.net/banque/portail/particulier/HomeConnexion?type=homeconnex')
......
......@@ -18,14 +18,14 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from .pages import LoginPage, AccountsPage, HistoryPage, UnknownPage
__all__ = ['BNPEnterprise']
class BNPEnterprise(BaseBrowser):
class BNPEnterprise(Browser):
DOMAIN = 'entreprises.bnpparibas.net'
PROTOCOL = 'https'
CERTHASH = '6789f1e08e18d6578dca88ce2e0354a99dbe7824736c01c9c4fa3b456d03b9e9'
......
......@@ -20,7 +20,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from .pages import LoginPage, AccountsList, AccountHistory, CardHistory, UpdateInfoPage, AuthenticationPage
......@@ -32,7 +32,7 @@ class BrowserIncorrectAuthenticationCode(BrowserIncorrectPassword):
pass
class Boursorama(BaseBrowser):
class Boursorama(Browser):
DOMAIN = 'www.boursorama.com'
PROTOCOL = 'https'
CERTHASH = ['6bdf8b6dd177bd417ddcb1cfb818ede153288e44115eb269f2ddd458c8461039', 'b290ef629c88f0508e9cc6305421c173bd4291175e3ddedbee05ee666b34c20e']
......@@ -51,7 +51,7 @@ class Boursorama(BaseBrowser):
*args, **kwargs):
self.device = device
self.enable_twofactors = enable_twofactors
BaseBrowser.__init__(self, *args, **kwargs)
Browser.__init__(self, *args, **kwargs)
def home(self):
if not self.is_logged():
......
......@@ -21,13 +21,13 @@
from .pages.compose import ComposeFrame, ComposePage, ConfirmPage, SentPage
from .pages.login import LoginPage, LoginSASPage
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
__all__ = ['BouyguesBrowser']
class BouyguesBrowser(BaseBrowser):
class BouyguesBrowser(Browser):
DOMAIN = 'www.bouyguestelecom.fr'
PAGES = {
'http://www.espaceclient.bouyguestelecom.fr/ECF/jsf/client/envoiSMS/viewEnvoiSMS.jsf': ComposePage,
......
......@@ -21,7 +21,7 @@
from urlparse import urlsplit, parse_qsl
from datetime import datetime
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword, BrowserBanned
from weboob.tools.browser import Browser, BrowserIncorrectPassword, BrowserBanned
from .pages import LoginPage, Initident, CheckPassword, repositionnerCheminCourant, BadLoginPage, AccountDesactivate, \
AccountList, AccountHistory, CardsList, UnavailablePage, \
......@@ -33,7 +33,7 @@ from weboob.capabilities.bank import Transfer
__all__ = ['BPBrowser']
class BPBrowser(BaseBrowser):
class BPBrowser(Browser):
DOMAIN = 'voscomptesenligne.labanquepostale.fr'
PROTOCOL = 'https'
CERTHASH = ['d10d09246853237892d5fb44685826ea99bfdeaaf29fac6dd236dae8cb103c39', 'ccdf2885f1d6df19e15d098dd52fd486609d891ebd2724970a5cfcb9254b6fa5']
......@@ -63,7 +63,7 @@ class BPBrowser(BaseBrowser):
def __init__(self, *args, **kwargs):
kwargs['parser'] = ('lxml',)
BaseBrowser.__init__(self, *args, **kwargs)
Browser.__init__(self, *args, **kwargs)
def home(self):
self.location('https://voscomptesenligne.labanquepostale.fr/wsost/OstBrokerWeb/loginform?TAM_OP=login&'
......
......@@ -20,7 +20,7 @@
import urllib
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from .pages import LoginPage, LoginResultPage, AccountsPage, EmptyPage, TransactionsPage
......@@ -28,7 +28,7 @@ from .pages import LoginPage, LoginResultPage, AccountsPage, EmptyPage, Transact
__all__ = ['BredBrowser']
class BredBrowser(BaseBrowser):
class BredBrowser(Browser):
PROTOCOL = 'https'
DOMAIN = 'www.bred.fr'
CERTHASH = ['9b77dab9c84e1dc9e0798de561a6541ff15f038f60b36ca74c29be1def6c19a3', '375f1fed165d34aacaaf71674ab14ca6c1b38404cf748278714fde3c58385ff0', '0853a056453b56aea6a29085ef3f3721b18db2052aa8e84220720d44e0eb22af']
......@@ -54,7 +54,7 @@ class BredBrowser(BaseBrowser):
self.accnum = accnum.replace(' ','').zfill(11)
self.DOMAIN = 'www.%s.fr' % website
self.website = website
BaseBrowser.__init__(self, *args, **kwargs)
Browser.__init__(self, *args, **kwargs)
def is_logged(self):
return self.page is not None and not self.is_on_page(LoginPage)
......
......@@ -2,7 +2,7 @@
import urllib
from weboob.tools.browser import BaseBrowser
from weboob.tools.browser import Browser
from .pages.index import IndexPage
from .pages.torrents import TorrentsPage, TorrentPage
......@@ -11,11 +11,11 @@ from .pages.torrents import TorrentsPage, TorrentPage
__all__ = ['BTDiggBrowser']
class BTDiggBrowser(BaseBrowser):
class BTDiggBrowser(Browser):
DOMAIN = 'btdigg.org'
PROTOCOL = 'https'
ENCODING = 'utf-8'
USER_AGENT = BaseBrowser.USER_AGENTS['wget']
USER_AGENT = Browser.USER_AGENTS['wget']
PAGES = {'https://btdigg.org/': IndexPage,
'https://btdigg.org/search?.*q=[^?]*': TorrentsPage,
'https://btdigg.org/search?.*info_hash=[^?]*': TorrentPage,
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserHTTPNotFound
from weboob.tools.browser import Browser, BrowserHTTPNotFound
from .pages import TorrentsPage, TorrentPage
......@@ -26,11 +26,11 @@ from .pages import TorrentsPage, TorrentPage
__all__ = ['BtmonBrowser']
class BtmonBrowser(BaseBrowser):
class BtmonBrowser(Browser):
DOMAIN = 'www.btmon.com'
PROTOCOL = 'http'
ENCODING = 'utf-8'
USER_AGENT = BaseBrowser.USER_AGENTS['wget']
USER_AGENT = Browser.USER_AGENTS['wget']
PAGES = {
'http://www.btmon.com/torrent/\?f=.*': TorrentsPage,
'http://www.btmon.com/.*torrent.html': TorrentPage,
......
......@@ -22,7 +22,7 @@ import ssl
import hashlib
from urlparse import urlsplit
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from .pages import LoginPage, IndexPage, ErrorPage, UnavailablePage
......@@ -30,7 +30,7 @@ from .pages import LoginPage, IndexPage, ErrorPage, UnavailablePage
__all__ = ['CaisseEpargne']
class CaisseEpargne(BaseBrowser):
class CaisseEpargne(Browser):
DOMAIN = 'www.caisse-epargne.fr'
PROTOCOL = 'https'
CERTHASH = ['dfff27d6db1fcdf1cea3ab8e3c1ca4f97c971262e95be49f3385b40c97fe640c', '9894ab2088630f341de821a09f1286c525f854f62ac186bd442368b4692c5969']
......@@ -43,10 +43,10 @@ class CaisseEpargne(BaseBrowser):
def __init__(self, nuser, *args, **kwargs):
self.nuser = nuser
BaseBrowser.__init__(self, *args, **kwargs)
Browser.__init__(self, *args, **kwargs)
def _certhash(self, domain, port=443):
# XXX overload the BaseBrowser method to force use of TLSv1.
# XXX overload the Browser method to force use of TLSv1.
certs = ssl.get_server_certificate((domain, port), ssl_version=ssl.PROTOCOL_TLSv1)
return hashlib.sha256(certs).hexdigest()
......
......@@ -22,7 +22,7 @@ import urllib
import lxml.etree
from weboob.tools.browser import BaseBrowser
from weboob.tools.browser import Browser
from weboob.tools.browser.decorators import id2url
from .pages import ChannelsPage, VideoPage
......@@ -42,7 +42,7 @@ class XMLParser(object):
return lxml.etree.XML(data.get_data(), parser)
class CanalplusBrowser(BaseBrowser):
class CanalplusBrowser(Browser):
DOMAIN = u'service.canal-plus.com'
ENCODING = 'utf-8'
PAGES = {
......@@ -60,7 +60,7 @@ class CanalplusBrowser(BaseBrowser):
}
def __init__(self, quality, *args, **kwargs):
BaseBrowser.__init__(self, parser=self.PARSER, *args, **kwargs)
Browser.__init__(self, parser=self.PARSER, *args, **kwargs)
self.quality = self.FORMATS.get(quality, self.FORMATS['hd'])
def home(self):
......
......@@ -20,7 +20,7 @@
from datetime import datetime, date, time
from weboob.tools.browser import BaseBrowser
from weboob.tools.browser import Browser
from weboob.tools.misc import to_unicode
from weboob.tools.browser import BrokenPageError
......@@ -28,11 +28,11 @@ from weboob.tools.browser import BrokenPageError
__all__ = ['CanalTP']
class CanalTP(BaseBrowser):
class CanalTP(Browser):
DOMAIN = 'widget.canaltp.fr'
def __init__(self, **kwargs):
BaseBrowser.__init__(self, '', **kwargs)
Browser.__init__(self, '', **kwargs)
def iter_station_search(self, pattern):
url = u'http://widget.canaltp.fr/Prochains_departs_15122009/dev/gare.php?txtrech=%s' % unicode(pattern)
......
......@@ -15,7 +15,7 @@ from weboob.capabilities.base import NotAvailable
from weboob.tools.misc import to_unicode
from weboob.tools.browser import Page
from weboob.tools.browser import BrokenPageError
from weboob.tools.browser import BaseBrowser
from weboob.tools.browser import Browser
from weboob.tools.browser.decorators import id2url
from weboob.capabilities.image import BaseImage
from weboob.capabilities.video import BaseVideo
......@@ -100,7 +100,7 @@ class VideoPage(Page):
return video
class CappedBrowser(BaseBrowser):
class CappedBrowser(Browser):
DOMAIN = 'capped.tv'
PROTOCOL = 'http'
ENCODING = None
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from weboob.tools.browser import Browser, BrowserIncorrectPassword
from .pages import LoginPage, HomePage, HistoryPage, RentedPage
......@@ -27,7 +27,7 @@ __all__ = ['ChampslibresBrowser']
# Browser
class ChampslibresBrowser(BaseBrowser):
class ChampslibresBrowser(Browser):
PROTOCOL = 'http'
ENCODING = 'utf-8'
PAGES = {
......
......@@ -17,7 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser
from weboob.tools.browser import Browser
from .pages import IndexPage, TrackPage
......@@ -25,7 +25,7 @@ from .pages import IndexPage, TrackPage
__all__ = ['ChronopostBrowser']
class ChronopostBrowser(BaseBrowser):
class ChronopostBrowser(Browser):
PROTOCOL = 'http'
DOMAIN = 'www.chronopost.fr'
ENCODING = None
......