[iformatter] move format_dict methods' content from PrettyFormatter to IFormatter
This commit is contained in:
parent
feb0e378dc
commit
ce60db2e57
1 changed files with 7 additions and 10 deletions
|
|
@ -211,7 +211,13 @@ class IFormatter(object):
|
||||||
:type collection: BaseCollection
|
:type collection: BaseCollection
|
||||||
:rtype: str
|
: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):
|
class PrettyFormatter(IFormatter):
|
||||||
|
|
@ -240,15 +246,6 @@ class PrettyFormatter(IFormatter):
|
||||||
def get_description(self, obj):
|
def get_description(self, obj):
|
||||||
return None
|
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):
|
def formatter_test_output(Formatter, obj):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue