implement max_results option and infinite search for youtube
This commit is contained in:
parent
6ecf722f66
commit
53f6571fee
7 changed files with 82 additions and 31 deletions
|
|
@ -23,7 +23,7 @@ from optparse import OptionGroup, OptionParser
|
|||
|
||||
from weboob.core.ouiboube import Weboob
|
||||
from weboob.tools.config.iconfig import ConfigError
|
||||
from weboob.tools.backend import ObjectNotSupported
|
||||
from weboob.tools.backend import ObjectNotAvailable, ObjectNotSupported
|
||||
from weboob.tools.misc import iter_fields
|
||||
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ class BaseApplication(object):
|
|||
fields = [k for k, v in iter_fields(obj)]
|
||||
try:
|
||||
backend.fillobj(obj, fields)
|
||||
except ObjectNotSupported, e:
|
||||
except (ObjectNotAvailable, ObjectNotSupported), e:
|
||||
logging.warning(u'Could not retrieve required fields (%s): %s' % (','.join(fields), e))
|
||||
return obj
|
||||
|
||||
|
|
@ -213,6 +213,7 @@ class BaseApplication(object):
|
|||
yield sub
|
||||
|
||||
def complete(self, backend, count, selected_fields, function, *args, **kwargs):
|
||||
assert count is None or count > 0
|
||||
res = getattr(backend, function)(*args, **kwargs)
|
||||
|
||||
if self.selected_fields:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue