From ce60db2e57eadde4b85cbde708be6b223ed40520 Mon Sep 17 00:00:00 2001 From: Bezleputh Date: Tue, 24 Jun 2014 10:17:23 +0200 Subject: [PATCH] [iformatter] move format_dict methods' content from PrettyFormatter to IFormatter --- .../tools/application/formatters/iformatter.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/weboob/tools/application/formatters/iformatter.py b/weboob/tools/application/formatters/iformatter.py index bc44eec60a..fa75f814f3 100644 --- a/weboob/tools/application/formatters/iformatter.py +++ b/weboob/tools/application/formatters/iformatter.py @@ -211,7 +211,13 @@ def format_collection(self, collection, only): :type collection: BaseCollection :rtype: str """ - return NotImplementedError() + if only is False or collection.basename in only: + if collection.basename and collection.title: + self.output(u'%s~ (%s) %s (%s)%s' % + (self.BOLD, collection.basename, collection.title, collection.backend, self.NC)) + else: + self.output(u'%s~ (%s) (%s)%s' % + (self.BOLD, collection.basename, collection.backend, self.NC)) class PrettyFormatter(IFormatter): @@ -240,15 +246,6 @@ def get_title(self, obj): def get_description(self, obj): return None - def format_collection(self, collection, only): - if only is False or collection.basename in only: - if collection.basename and collection.title: - self.output(u'%s~ (%s) %s (%s)%s' % - (self.BOLD, collection.basename, collection.title, collection.backend, self.NC)) - else: - self.output(u'%s~ (%s) (%s)%s' % - (self.BOLD, collection.basename, collection.backend, self.NC)) - def formatter_test_output(Formatter, obj): """ -- GitLab