completion on IDs for 'info' and 'play' (closes #396)

This commit is contained in:
Romain Bignon 2010-09-27 00:03:34 +02:00
commit 5c53bb52b5

View file

@ -153,6 +153,15 @@ class Videoob(ReplApplication):
if video:
return video
def _complete_id(self):
return ['%s@%s' % (video.id, video.backend) for video in self.videos]
def complete_play(self, text, line, *ignored):
args = line.split(' ')
if len(args) == 2:
return self._complete_id()
def do_play(self, _id):
"""
play ID
@ -178,6 +187,11 @@ class Videoob(ReplApplication):
print 'The URL of this video is:'
print ' %s' % video.url
def complete_info(self, text, line, *ignored):
args = line.split(' ')
if len(args) == 2:
return self._complete_id()
def do_info(self, _id):
"""
info ID