nice display if formatter could not be loaded
This commit is contained in:
parent
e8be6f7794
commit
e7e0d9cc59
1 changed files with 6 additions and 1 deletions
|
|
@ -18,10 +18,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
"""
|
||||
|
||||
import logging
|
||||
import sys, tty, termios
|
||||
import re
|
||||
from inspect import getargspec
|
||||
from functools import partial
|
||||
|
||||
from weboob.modules import BackendsConfig
|
||||
|
||||
from .base import BaseApplication
|
||||
|
|
@ -169,7 +171,10 @@ class ConsoleApplication(BaseApplication):
|
|||
output_format = self.default_output_format
|
||||
else:
|
||||
output_format = 'table'
|
||||
print formatters[output_format].format(command_result)
|
||||
try:
|
||||
print formatters[output_format].format(command_result)
|
||||
except ImportError, e:
|
||||
logging.error(u'Could not use formatter "%s". Error: %s' % (output_format, e.message))
|
||||
return 0
|
||||
elif isinstance(command_result, int):
|
||||
return command_result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue