diff --git a/modules/afer/favicon.png b/modules/afer/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..011544f521cd065490863cf4e22c45c18b9e5065 Binary files /dev/null and b/modules/afer/favicon.png differ diff --git a/modules/amundi/favicon.png b/modules/amundi/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..e6899c7283ccef244f062c1a2f6b924c2211f7a3 Binary files /dev/null and b/modules/amundi/favicon.png differ diff --git a/modules/bforbank/favicon.png b/modules/bforbank/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..25593ea7ac4f5f6aeeb80481fc61880f79206350 Binary files /dev/null and b/modules/bforbank/favicon.png differ diff --git a/modules/blablacar/favicon.png b/modules/blablacar/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..3de059af7dbedb5e4b832c214aa085ba6160c95c Binary files /dev/null and b/modules/blablacar/favicon.png differ diff --git a/modules/btdigg/__init__.py b/modules/btdigg/__init__.py deleted file mode 100644 index 62079d582aa6db16147863df3eacd818ad88f883..0000000000000000000000000000000000000000 --- a/modules/btdigg/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .module import BTDiggModule - -__all__ = ['BTDiggModule'] diff --git a/modules/btdigg/browser.py b/modules/btdigg/browser.py deleted file mode 100644 index 4f4c78e4d4bd638eb12a15510b8c6c32a8f3d1e3..0000000000000000000000000000000000000000 --- a/modules/btdigg/browser.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -from weboob.browser import PagesBrowser, URL - -from .pages.index import IndexPage -from .pages.torrents import TorrentsPage, TorrentPage - - -__all__ = ['BTDiggBrowser'] - - -class BTDiggBrowser(PagesBrowser): - BASEURL = 'https://btdigg.org' - - index_page = URL('/$', IndexPage) - torrents_page = URL('/search\?.*q=(?P.+)', TorrentsPage) - torrent_page = URL('/search\?.*info_hash=(?P.+)', TorrentPage) - - def home(self): - return self.index_page.go() - - def iter_torrents(self, pattern): - self.torrents_page.go(query=pattern) - return self.page.iter_torrents() - - def get_torrent(self, id): - self.torrent_page.go(hash=id) - return self.page.get_torrent() - - def get_torrent_file(self, id): - self.torrent_page.go(hash=id) - return self.page.get_torrent_file() diff --git a/modules/btdigg/module.py b/modules/btdigg/module.py deleted file mode 100644 index 4f4d8dc24e7b29a0f57826f6169fe48d57306e11..0000000000000000000000000000000000000000 --- a/modules/btdigg/module.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- - -from weboob.capabilities.torrent import CapTorrent -from weboob.tools.backend import Module - -from .browser import BTDiggBrowser - - -__all__ = ['BTDiggModule'] - - -class BTDiggModule(Module, CapTorrent): - NAME = 'btdigg' - MAINTAINER = u'Matthieu Rakotojaona' - EMAIL = 'matthieu.rakotojaona@gmail.com' - VERSION = '1.2' - DESCRIPTION = 'The BitTorrent DHT search engine.' - LICENSE = 'CC0' - BROWSER = BTDiggBrowser - - def create_default_browser(self): - return self.create_browser() - - def get_torrent(self, id): - return self.browser.get_torrent(id) - - def get_torrent_file(self, id): - return self.browser.get_torrent_file(id) - - def iter_torrents(self, pattern): - return self.browser.iter_torrents(pattern.replace(' ', '+')) diff --git a/modules/btdigg/pages/__init__.py b/modules/btdigg/pages/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/modules/btdigg/pages/index.py b/modules/btdigg/pages/index.py deleted file mode 100644 index d522186bf10a25b8622e8a68bd867bb90417892b..0000000000000000000000000000000000000000 --- a/modules/btdigg/pages/index.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -from weboob.browser.pages import HTMLPage - - -class IndexPage(HTMLPage): - pass diff --git a/modules/btdigg/pages/torrents.py b/modules/btdigg/pages/torrents.py deleted file mode 100644 index e310dc5f92f75a6b843ad17365ecdf9625385adb..0000000000000000000000000000000000000000 --- a/modules/btdigg/pages/torrents.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- - -from datetime import datetime, timedelta - -from weboob.tools.misc import get_bytes_size -from weboob.browser.pages import HTMLPage -from weboob.browser.elements import ItemElement, ListElement, method -from weboob.capabilities.torrent import Torrent, MagnetOnly -from weboob.browser.filters.standard import CleanText, Regexp - - -class TorrentsPage(HTMLPage): - @method - class iter_torrents(ListElement): - item_xpath = '//div[@id="search_res"]/table/tr' - - class item(ItemElement): - klass = Torrent - - obj_id = Regexp(CleanText('./td/table/tr/td[@class="torrent_name"]/a/@href'), - r'info_hash=([0-9a-f]+)', '\\1') - obj_name = CleanText('./td/table/tr/td[@class="torrent_name"]') - obj_magnet = CleanText('./td/table/tr/td[@class="ttth"]/a/@href') - - def obj_date(self): - valueago, valueunit, _ = CleanText('./td/table/tr/td[5]/span[@class="attr_val"]')(self).split() - delta = timedelta(**{valueunit: float(valueago)}) - return datetime.now() - delta - - def obj_size(self): - value, unit = CleanText('./td/table/tr/td[2]/span[@class="attr_val"]')(self).split() - return get_bytes_size(float(value), unit) - - -class TorrentPage(HTMLPage): - @method - class get_torrent(ItemElement): - klass = Torrent - ROOT = '//table[@class="torrent_info_tbl"]' - - obj_id = Regexp(CleanText(ROOT + '/tr[3]/td[2]/a/@href'), r'urn:btih:([0-9a-f]+)', '\\1') - obj_name = CleanText(ROOT + '/tr[4]/td[2]') - obj_magnet = CleanText(ROOT + '/tr[3]/td[2]/a/@href') - - def obj_files(self): - return [_.text for _ in self.xpath(self.ROOT + '/tr[position() > 15]/td[2]')] - - def obj_date(self): - valueago, valueunit, _ = CleanText(self.ROOT + '/tr[7]/td[2]')(self).split() - delta = timedelta(**{valueunit: float(valueago)}) - return datetime.now() - delta - - def obj_size(self): - value, unit = CleanText(self.ROOT + '/tr[6]/td[2]')(self).split() - return get_bytes_size(float(value), unit) - - def get_torrent_file(self): - raise MagnetOnly(self.get_torrent().magnet) diff --git a/modules/btdigg/test.py b/modules/btdigg/test.py deleted file mode 100644 index 4aa387cbfd51d384b5ddf78906d82c163890e276..0000000000000000000000000000000000000000 --- a/modules/btdigg/test.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- - -from weboob.tools.test import BackendTest -from weboob.capabilities.torrent import MagnetOnly - -from random import choice - - -class BTDiggTest(BackendTest): - MODULE = 'btdigg' - - def test_iter_torrents(self): - # try something popular so we sometimes get a magnet-only torrent - l = list(self.backend.iter_torrents('ubuntu linux')) - self.assertTrue(len(l) == 10) - for torrent in l: - assert torrent.name - assert torrent.size - assert torrent.magnet - assert torrent.date - - self.assertEquals(40, len(torrent.id)) - - def test_get_random_torrentfile(self): - torrent = choice(list(self.backend.iter_torrents('ubuntu linux'))) - full_torrent = self.backend.get_torrent(torrent.id) - try: - self.backend.get_torrent_file(torrent.id) - except MagnetOnly as e: - assert e.magnet.startswith("magnet:") - assert e.magnet == full_torrent.magnet - - def test_get_special_torrent(self): - torrent = self.backend.get_torrent("abd1d2648c97958789d62f6a6a1f5d33f4eff5be") - assert torrent.name == u'Ubuntu Linux Toolbox - 1000+ Commands for Ubuntu and Debian Power Users' - assert len(torrent.files) == 3 - assert torrent.size == float(7004487.68) - dt = torrent.date - assert dt.year == 2013 - assert dt.month == 12 diff --git a/modules/caels/favicon.png b/modules/caels/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..b882c5c20908a5095ac4c05cf736e53fd838c115 Binary files /dev/null and b/modules/caels/favicon.png differ diff --git a/modules/colisprive/favicon.png b/modules/colisprive/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..e14cf761efafb8ad4cbeea6cc6123b0b3ac302d0 Binary files /dev/null and b/modules/colisprive/favicon.png differ diff --git a/modules/edf/favicon.png b/modules/edf/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..c8fd1855909e483e26fc767cfa778063541f9343 Binary files /dev/null and b/modules/edf/favicon.png differ diff --git a/modules/entreparticuliers/favicon.png b/modules/entreparticuliers/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..ec5e4389e928c23e98170d6f676aa90e7ac300be Binary files /dev/null and b/modules/entreparticuliers/favicon.png differ diff --git a/modules/genericnewspaper/favicon.png b/modules/genericnewspaper/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..cf932aba8eeb940b5530be28d61419977e356939 Binary files /dev/null and b/modules/genericnewspaper/favicon.png differ diff --git a/modules/jvmalin/favicon.png b/modules/jvmalin/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..e9d870fc1a38e7aed50a34295993ed7779661432 Binary files /dev/null and b/modules/jvmalin/favicon.png differ diff --git a/modules/ldlc/favicon.png b/modules/ldlc/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..5f26bfa03e16ea0f57e86e6d3a4f55f50d96b77f Binary files /dev/null and b/modules/ldlc/favicon.png differ diff --git a/modules/ldlc/test.py b/modules/ldlc/test.py new file mode 100644 index 0000000000000000000000000000000000000000..96b9f6d145d8d53fe24ed83325f69534f334fe86 --- /dev/null +++ b/modules/ldlc/test.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- + +# Copyright(C) 2013-2014 Florent Fourcot +# +# This file is part of weboob. +# +# weboob is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with weboob. If not, see . + + +from weboob.tools.test import BackendTest + + +class LdlcTest(BackendTest): + MODULE = 'ldlc' + + def test_downloadbills(self): + """ + Iter all bills and try to download it. + """ + for subscription in self.backend.iter_subscription(): + for bill in self.backend.iter_documents(subscription.id): + self.backend.download_document(bill.id) + + def test_list(self): + """ + Test listing of subscriptions. + """ + subscriptions = list(self.backend.iter_subscription()) + self.assertTrue(len(subscriptions) > 0, msg="Account listing failed") diff --git a/modules/linuxjobs/favicon.png b/modules/linuxjobs/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..aa45277d610dd89e543ce1cfc8da5107d1cfd2db Binary files /dev/null and b/modules/linuxjobs/favicon.png differ diff --git a/modules/mangafox/favicon.png b/modules/mangafox/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..2f2ae0c2929d53086a6ed7ee5b9f09cb569561ec Binary files /dev/null and b/modules/mangafox/favicon.png differ diff --git a/modules/mangago/favicon.png b/modules/mangago/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..1b4878d745c2b5a21197facba91e18c716b5b498 Binary files /dev/null and b/modules/mangago/favicon.png differ diff --git a/modules/mangareader/favicon.png b/modules/mangareader/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..b355f93bfbaeec2a957daee9e978795de2f659ab Binary files /dev/null and b/modules/mangareader/favicon.png differ diff --git a/modules/manpower/favicon.png b/modules/manpower/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..626fb9fed02ed2010a8d44c6c35eb7ef3375158a Binary files /dev/null and b/modules/manpower/favicon.png differ diff --git a/modules/n26/favicon.png b/modules/n26/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..af3fc953a7cec5b57396d935424a5ca4bef57a1c Binary files /dev/null and b/modules/n26/favicon.png differ diff --git a/modules/nettokom/favicon.png b/modules/nettokom/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..55bfe52a7f9a341d9809ad520ad207fd683db7c4 Binary files /dev/null and b/modules/nettokom/favicon.png differ diff --git a/modules/openedx/favicon.png b/modules/openedx/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..e2797b3a29d238c65d763acad14e640d1aeb546b Binary files /dev/null and b/modules/openedx/favicon.png differ diff --git a/modules/ovh/favicon.png b/modules/ovh/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..5165260ac7902f893f9aca2800314fa617a9a4d2 Binary files /dev/null and b/modules/ovh/favicon.png differ diff --git a/modules/poivy/favicon.png b/modules/poivy/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..1484c43e233a08453b199f92ec8d2f3910ecb790 Binary files /dev/null and b/modules/poivy/favicon.png differ diff --git a/modules/pornhub/favicon.png b/modules/pornhub/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..2884ef6abbc61ebb5559099e7bebb32c8b640058 Binary files /dev/null and b/modules/pornhub/favicon.png differ diff --git a/modules/residentadvisor/favicon.png b/modules/residentadvisor/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..5dccc9c1d9e608e5d9eebafe9f948d0b1492649e Binary files /dev/null and b/modules/residentadvisor/favicon.png differ diff --git a/modules/s2e/favicon.png b/modules/s2e/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..9232b298ba76ead6774c90531acd2a67d6ddea35 Binary files /dev/null and b/modules/s2e/favicon.png differ diff --git a/modules/yomoni/favicon.png b/modules/yomoni/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..8f5bde57c79591443ccbecd8bff851723c50e60f Binary files /dev/null and b/modules/yomoni/favicon.png differ diff --git a/tools/weboob_lint.py b/tools/weboob_lint.py index 1524addf17ad5f3d746c76f8049624cdc972681f..5d023aa12b8e8ad51175a09dc27cfa5183a3e5eb 100755 --- a/tools/weboob_lint.py +++ b/tools/weboob_lint.py @@ -24,8 +24,10 @@ backends_without_icons.append(name) if backends_without_tests: + backends_without_tests.sort() print('Modules without tests: %s' % backends_without_tests) if backends_without_icons: + backends_without_icons.sort() print('Modules without icons: %s' % backends_without_icons) if backends_without_tests or backends_without_icons: