fixes when no backends are loaded

This commit is contained in:
Romain Bignon 2010-09-25 02:16:07 -04:00
commit f4f9ef25f4
2 changed files with 16 additions and 6 deletions

View file

@ -224,6 +224,13 @@ class Videoob(ReplApplication):
If PATTERN is not given, this command will search for the latest videos.
"""
if len(self.enabled_backends) == 0:
if self.interactive:
print 'No backend loaded. Please use the "backends" command.'
else:
print 'No backend loaded.'
return 1
self.set_formatter_header(u'Search pattern: %s' % pattern if pattern else u'Latest videos')
self.videos = []
for backend, video in self.do('iter_search_results', pattern=pattern, nsfw=self.options.nsfw,