new class BackendConfig to manage backend configs
This commit is contained in:
parent
be2be4af9c
commit
cb1372b99f
23 changed files with 234 additions and 171 deletions
|
|
@ -21,8 +21,8 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
from weboob.capabilities.video import ICapVideo
|
||||
from weboob.tools.backend import BaseBackend
|
||||
from weboob.tools.value import ValuesDict, Value
|
||||
from weboob.tools.backend import BaseBackend, BackendConfig
|
||||
from weboob.tools.value import Value
|
||||
|
||||
from .browser import CanalplusBrowser
|
||||
from .pages import CanalplusVideo
|
||||
|
|
@ -40,11 +40,11 @@ class CanalplusBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
VERSION = '0.9'
|
||||
DESCRIPTION = 'Canal plus french TV'
|
||||
LICENSE = 'GPLv3'
|
||||
CONFIG = ValuesDict(Value('quality', label='Quality of videos', choices=['hd', 'sd'], default='hd'))
|
||||
CONFIG = BackendConfig(Value('quality', label='Quality of videos', choices=['hd', 'sd'], default='hd'))
|
||||
BROWSER = CanalplusBrowser
|
||||
|
||||
def create_default_browser(self):
|
||||
return self.create_browser(quality=self.config['quality'])
|
||||
return self.create_browser(quality=self.config['quality'].get())
|
||||
|
||||
def iter_search_results(self, pattern=None, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
with self.browser:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue