do not print supported websites if empty
This commit is contained in:
parent
ac24cfa774
commit
04183000bc
1 changed files with 3 additions and 2 deletions
|
|
@ -61,13 +61,14 @@ class ManpageHelpFormatter(optparse.HelpFormatter):
|
||||||
def format_description(self, description):
|
def format_description(self, description):
|
||||||
desc = u'.SH DESCRIPTION\n.LP\n\n%s\n' % description
|
desc = u'.SH DESCRIPTION\n.LP\n\n%s\n' % description
|
||||||
if hasattr(self.app, 'CAPS'):
|
if hasattr(self.app, 'CAPS'):
|
||||||
desc += u'\n.SS Supported websites:\n'
|
|
||||||
self.app.weboob.modules_loader.load_all()
|
self.app.weboob.modules_loader.load_all()
|
||||||
backends = []
|
backends = []
|
||||||
for name, backend in self.app.weboob.modules_loader.loaded.iteritems():
|
for name, backend in self.app.weboob.modules_loader.loaded.iteritems():
|
||||||
if backend.has_caps(self.app.CAPS):
|
if backend.has_caps(self.app.CAPS):
|
||||||
backends.append(u'* %s (%s)' % (name, backend.description))
|
backends.append(u'* %s (%s)' % (name, backend.description))
|
||||||
desc += u'\n.br\n'.join(sorted(backends))
|
if len(backends) > 0:
|
||||||
|
desc += u'\n.SS Supported websites:\n'
|
||||||
|
desc += u'\n.br\n'.join(sorted(backends))
|
||||||
return desc
|
return desc
|
||||||
|
|
||||||
def format_commands(self, commands):
|
def format_commands(self, commands):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue