From 9873506dc9e547ba75a76621d1a7b331d5096b62 Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 4 Dec 2010 17:11:06 +0100 Subject: [PATCH] Cleaning the meteofrance backend source code Signed-off-by: Cedric --- weboob/backends/meteofrance/backend.py | 6 ++--- weboob/backends/meteofrance/browser.py | 2 +- weboob/backends/meteofrance/pages/meteo.py | 27 ---------------------- 3 files changed, 4 insertions(+), 31 deletions(-) diff --git a/weboob/backends/meteofrance/backend.py b/weboob/backends/meteofrance/backend.py index 9dd6665c..6b67764a 100644 --- a/weboob/backends/meteofrance/backend.py +++ b/weboob/backends/meteofrance/backend.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2010 Julien Veyssier +# Copyright(C) 2010 Cedric Defortis # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,10 +26,10 @@ __all__ = ['MeteofranceBackend'] class MeteofranceBackend(BaseBackend, ICapWeather): NAME = 'meteofrance' - MAINTAINER = 'Cedric D.' + MAINTAINER = 'Cedric Defortis' EMAIL = 'cedric@aiur.fr' VERSION = '0.1' - DESCRIPTION = 'MeteoFrance' + DESCRIPTION = 'Get forecasts from the MeteoFrance website' LICENSE = 'GPLv3' #CONFIG = ValuesDict(Value('domain', label='Domain (example "ssl.what.cd")'), # Value('protocol', label='Protocol to use', choices=('http', 'https')), diff --git a/weboob/backends/meteofrance/browser.py b/weboob/backends/meteofrance/browser.py index 682bd8eb..c990c799 100644 --- a/weboob/backends/meteofrance/browser.py +++ b/weboob/backends/meteofrance/browser.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2010 Julien Veyssier +# Copyright(C) 2010 Cedric Defortis # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/weboob/backends/meteofrance/pages/meteo.py b/weboob/backends/meteofrance/pages/meteo.py index 0b900cfb..7753df98 100644 --- a/weboob/backends/meteofrance/pages/meteo.py +++ b/weboob/backends/meteofrance/pages/meteo.py @@ -78,30 +78,3 @@ class CityPage(BasePage): city_id = children.attrib.get("href").split("/")[-1] mcity = City( city_id, city_name) yield mcity - - def plop(self): - for div in self.document.getiterator('div'): - if div.attrib.get('id','') == 'column1': - title = div.text.strip() - elif div.attrib.get('class','') == 'download': - url = div.getchildren()[0].attrib.get('href','') - elif div.attrib.get('id','') == 'details': - size = float(div.getchildren()[0].getchildren()[5].text.split('(')[1].split('Bytes')[0]) - if len(div.getchildren()) > 1 \ - and div.getchildren()[1].attrib.get('class','') == 'col2' : - seed = div.getchildren()[1].getchildren()[7].text - leech = div.getchildren()[1].getchildren()[9].text - else: - seed = div.getchildren()[0].getchildren()[24].text - leech = div.getchildren()[0].getchildren()[26].text - elif div.attrib.get('class','') == 'nfo': - description = div.getchildren()[0].text - torrent = Torrent(id, title) - torrent.url = url - torrent.size = size - torrent.seeders = int(seed) - torrent.leechers = int(leech) - torrent.description = description - torrent.files = ['NYI'] - - return torrent