handle case if no backend name is specified

This commit is contained in:
Christophe Benz 2010-09-27 14:54:38 +02:00
commit c2af558743

View file

@ -115,16 +115,19 @@ class WeboobCfg(ReplApplication):
]) ])
self.format(row) self.format(row)
def do_info(self, name): def do_info(self, line):
""" """
info NAME info NAME
Display information about a backend. Display information about a backend.
""" """
if not line:
print 'No backend name was specified.'
return
try: try:
backend = self.weboob.modules_loader.get_or_load_module(name) backend = self.weboob.modules_loader.get_or_load_module(line)
except KeyError: except KeyError:
print 'No such backend: "%s"' % name print 'No such backend: "%s"' % line
return 1 return 1
print '.------------------------------------------------------------------------------.' print '.------------------------------------------------------------------------------.'