video_list formatter display count in interactive mode, the full ID otherwise
This commit is contained in:
parent
61deb66ac8
commit
24e3671f27
3 changed files with 8 additions and 2 deletions
|
|
@ -38,8 +38,11 @@ class VideoListFormatter(IFormatter):
|
|||
|
||||
def format_dict(self, item):
|
||||
self.count += 1
|
||||
backend = item['id'].split('@', 1)[1]
|
||||
result = u'%s(%d) %s (%s)%s\n' % (ReplApplication.BOLD, self.count, item['title'], backend, ReplApplication.NC)
|
||||
if self.interactive:
|
||||
backend = item['id'].split('@', 1)[1]
|
||||
result = u'%s(%d) %s (%s)%s\n' % (ReplApplication.BOLD, self.count, item['title'], backend, ReplApplication.NC)
|
||||
else:
|
||||
result = u'%s(%s) %s%s\n' % (ReplApplication.BOLD, item['id'], item['title'], ReplApplication.NC)
|
||||
result += ' %s' % item['duration']
|
||||
if item['author'] is not NotLoaded:
|
||||
result += ' - %s' % item['author']
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class IFormatter(object):
|
|||
self.display_keys = display_keys
|
||||
self.display_header = display_header
|
||||
self.return_only = return_only
|
||||
self.interactive = False
|
||||
|
||||
def after_format(self, formatted):
|
||||
raise NotImplementedError()
|
||||
|
|
|
|||
|
|
@ -881,6 +881,8 @@ class ReplApplication(Cmd, BaseApplication):
|
|||
self.formatter.display_header = False
|
||||
if self.options.no_keys:
|
||||
self.formatter.display_keys = False
|
||||
if self.interactive:
|
||||
self.formatter.interactive = True
|
||||
return name
|
||||
|
||||
def set_formatter_header(self, string):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue