Commit ce60db2e authored by Bezleputh's avatar Bezleputh Committed by Florent Fourcot

[iformatter] move format_dict methods' content from PrettyFormatter to IFormatter

parent feb0e378
......@@ -211,7 +211,13 @@ class IFormatter(object):
: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 @@ class PrettyFormatter(IFormatter):
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):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment