From 29de886fe61778a67b03d3bed3ccadaa9fbada7c Mon Sep 17 00:00:00 2001 From: Christophe Benz Date: Fri, 24 Sep 2010 11:35:02 +0200 Subject: [PATCH] add nsfw command --- weboob/applications/videoob/videoob.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/weboob/applications/videoob/videoob.py b/weboob/applications/videoob/videoob.py index eb487163..d0c2a897 100644 --- a/weboob/applications/videoob/videoob.py +++ b/weboob/applications/videoob/videoob.py @@ -56,6 +56,25 @@ class Videoob(ReplApplication): self.format(video) self.flush() + def do_nsfw(self, line): + """ + nsfw [on | off] + + If argument is given, enable or disable the non-suitable for work behavior. + + If no argument is given, print the current behavior. + """ + line = line.strip() + if line: + if line == 'on': + self.options.nsfw = True + elif line == 'off': + self.options.nsfw = False + else: + print 'Invalid argument "%s".' % line + else: + print "on" if self.options.nsfw else "off" + def do_search(self, pattern=None): """ search [PATTERN]