code clean
code clean
This commit is contained in:
parent
5c2ab81e16
commit
1847ea5f34
14 changed files with 54 additions and 22 deletions
|
|
@ -21,6 +21,10 @@ from weboob.capabilities.travel import ICapTravel, Station, Departure
|
|||
|
||||
from .browser import CanalTP
|
||||
|
||||
|
||||
__all__ = ['CanalTPBackend']
|
||||
|
||||
|
||||
class CanalTPBackend(BaseBackend, ICapTravel):
|
||||
NAME = 'canaltp'
|
||||
MAINTAINER = 'Romain Bignon'
|
||||
|
|
|
|||
|
|
@ -17,13 +17,17 @@
|
|||
|
||||
from __future__ import with_statement
|
||||
|
||||
from weboob.core.backend import BaseBackend
|
||||
from weboob.tools.backend import BaseBackend
|
||||
from weboob.tools.browser import BrowserUnavailable
|
||||
from weboob.capabilities.messages import ICapMessages, ICapMessagesReply, Message
|
||||
|
||||
from .feeds import ArticlesList
|
||||
from .browser import DLFP
|
||||
|
||||
|
||||
__all__ = ['DLFPBackend']
|
||||
|
||||
|
||||
class DLFPBackend(BaseBackend, ICapMessages, ICapMessagesReply):
|
||||
NAME = 'dlfp'
|
||||
MAINTAINER = 'Romain Bignon'
|
||||
|
|
|
|||
|
|
@ -15,15 +15,20 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
from __future__ import with_statement
|
||||
|
||||
from logging import warning
|
||||
|
||||
from weboob.core.backend import BaseBackend
|
||||
from weboob.capabilities.messages import ICapMessages, Message
|
||||
from weboob.tools.backend import BaseBackend
|
||||
|
||||
from .browser import FourChan
|
||||
|
||||
|
||||
__all__ = ['FourChanBackend']
|
||||
|
||||
|
||||
class FourChanBackend(BaseBackend, ICapMessages):
|
||||
NAME = 'fourchan'
|
||||
MAINTAINER = 'Romain Bignon'
|
||||
|
|
@ -32,7 +37,7 @@ class FourChanBackend(BaseBackend, ICapMessages):
|
|||
LICENSE = 'GPLv3'
|
||||
DESCRIPTION = "4chan website"
|
||||
|
||||
CONFIG = {'boards': BaseBackend.ConfigField(description='Boards'),
|
||||
CONFIG = {'boards': BaseBackend.ConfigField(description='Boards'),
|
||||
}
|
||||
STORAGE = {'boards': {}}
|
||||
BROWSER = FourChan
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ class GazelleBackend(BaseBackend, ICapTorrent):
|
|||
DESCRIPTION = 'gazelle bittorrent tracker'
|
||||
LICENSE = 'GPLv3'
|
||||
|
||||
CONFIG = {'username': BaseBackend.ConfigField(description='Username on website'),
|
||||
'password': BaseBackend.ConfigField(description='Password of account', is_masked=True),
|
||||
'protocol': BaseBackend.ConfigField(description='Protocol to use ("http" or "https")', regexp='^(http|https)$'),
|
||||
'domain': BaseBackend.ConfigField(description='Domain (example "ssl.what.cd")'),
|
||||
CONFIG = {'username': BaseBackend.ConfigField(description='Username on website'),
|
||||
'password': BaseBackend.ConfigField(description='Password of account', is_masked=True),
|
||||
'protocol': BaseBackend.ConfigField(description='Protocol to use ("http" or "https")', regexp='^(http|https)$'),
|
||||
'domain': BaseBackend.ConfigField(description='Domain (example "ssl.what.cd")'),
|
||||
}
|
||||
BROWSER = GazelleBrowser
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ class InaBackend(BaseBackend, ICapVideo):
|
|||
DESCRIPTION = 'INA french video archives'
|
||||
LICENSE = 'GPLv3'
|
||||
|
||||
CONFIG = {}
|
||||
BROWSER = InaBrowser
|
||||
|
||||
def get_video(self, _id):
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ from weboob.tools.browser import BasePage
|
|||
from ..video import InaVideo
|
||||
|
||||
|
||||
__ALL__ = ['VideoPage']
|
||||
__all__ = ['VideoPage']
|
||||
|
||||
|
||||
class VideoPage(BasePage):
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ class YoujizzBackend(BaseBackend, ICapVideo):
|
|||
DESCRIPTION = 'Youjizz videos website'
|
||||
LICENSE = 'GPLv3'
|
||||
|
||||
CONFIG = {}
|
||||
BROWSER = YoujizzBrowser
|
||||
|
||||
def get_video(self, _id):
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ class YoupornBackend(BaseBackend, ICapVideo):
|
|||
DESCRIPTION = 'Youporn videos website'
|
||||
LICENSE = 'GPLv3'
|
||||
|
||||
CONFIG = {}
|
||||
BROWSER = YoupornBrowser
|
||||
|
||||
def get_video(self, _id):
|
||||
|
|
|
|||
|
|
@ -33,5 +33,5 @@ class PornPage(BasePage):
|
|||
self.browser.select_form(nr=0)
|
||||
self.browser.submit(name='user_choice')
|
||||
return False
|
||||
except (ControlNotFoundError,FormNotFoundError):
|
||||
except (ControlNotFoundError, FormNotFoundError):
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@ from xml.dom import minidom
|
|||
from weboob.core.backend import BaseBackend
|
||||
from weboob.capabilities.weather import ICapWeather, CityNotFound, Current, Forecast
|
||||
|
||||
|
||||
__all__ = ['YWeatherBackend']
|
||||
|
||||
|
||||
class YWeatherBackend(BaseBackend, ICapWeather):
|
||||
NAME = 'yweather'
|
||||
MAINTAINER = 'Romain Bignon'
|
||||
|
|
@ -59,4 +63,5 @@ class YWeatherBackend(BaseBackend, ICapWeather):
|
|||
int(forecast.getAttribute('low')),
|
||||
int(forecast.getAttribute('high')),
|
||||
forecast.getAttribute('text'),
|
||||
'C')
|
||||
'C',
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue