From 8fee458824b4e80ef78af38780603e43e3b3735f Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 18 Jun 2014 15:43:05 +0200 Subject: [PATCH] Add some warnings --- weboob/tools/application/repl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weboob/tools/application/repl.py b/weboob/tools/application/repl.py index 4b3464b7..7796aa16 100644 --- a/weboob/tools/application/repl.py +++ b/weboob/tools/application/repl.py @@ -346,6 +346,7 @@ class ReplApplication(Cmd, ConsoleApplication): missing_fields = set(self.formatter.MANDATORY_FIELDS) - set(fields) # If a mandatory field is not selected, do not use the customized formatter if missing_fields: + print('Warning: you do not select enough mandatory fields for the formatter. Fallback to another. Hint: use option -f', file=sys.stderr) self.formatter = self.formatters_loader.build_formatter(ReplApplication.DEFAULT_FORMATTER) if self.formatter.DISPLAYED_FIELDS is not None: @@ -355,6 +356,7 @@ class ReplApplication(Cmd, ConsoleApplication): missing_fields = set(fields) - set(self.formatter.DISPLAYED_FIELDS + self.formatter.MANDATORY_FIELDS) # If a selected field is not displayed, do not use the customized formatter if missing_fields: + print('Warning: some selected fields will not be displayed by the formatter. Fallback to another. Hint: use option -f', file=sys.stderr) self.formatter = self.formatters_loader.build_formatter(ReplApplication.DEFAULT_FORMATTER) return self.weboob.do(self._do_complete, self.options.count, fields, function, *args, **kwargs)