From a03f2b627ee24d76020c2d65ae18f825b6904120 Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 18 Apr 2014 10:24:47 +0200 Subject: [PATCH] Fix selecting a field in non-interactive mode The command: boobank ing history blabla@ing -f table -s label,amount,date was bugued, since b770163d9b85b9540fcdb63c7a2152defc886149. Before to iter the history, boobank uses the get_object method, with fields set to []. The goal is to not use the selected_fields configured by the user. But the commit b770163d9b85b9540fcdb63c7a2152defc886149 added: "or self.selected_fields" Since "if []" return false, it cannot works. --- weboob/tools/application/repl.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/weboob/tools/application/repl.py b/weboob/tools/application/repl.py index 5def46a9..556c671a 100644 --- a/weboob/tools/application/repl.py +++ b/weboob/tools/application/repl.py @@ -351,12 +351,12 @@ class ReplApplication(Cmd, ConsoleApplication): kwargs['backends'].append(backend) else: kwargs['backends'] = backends - - fields = kwargs.pop('fields', self.selected_fields) or self.selected_fields - if '$direct' in fields: - fields = [] - elif '$full' in fields: - fields = None + fields = kwargs.pop('fields', self.selected_fields) + if not fields and fields != []: + if '$direct' in fields: + fields = [] + elif '$full' in fields: + fields = None return self.weboob.do(self._do_complete, self.options.count, fields, function, *args, **kwargs) # -- command tools ------------