From 5c53bb52b5af8d9c642df3ee162c463bbb89bb89 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Mon, 27 Sep 2010 00:03:34 +0200 Subject: [PATCH] completion on IDs for 'info' and 'play' (closes #396) --- weboob/applications/videoob/videoob.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/weboob/applications/videoob/videoob.py b/weboob/applications/videoob/videoob.py index bfccb6ec..30ad8589 100644 --- a/weboob/applications/videoob/videoob.py +++ b/weboob/applications/videoob/videoob.py @@ -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