set nsfw true by default

This commit is contained in:
Christophe Benz 2010-09-27 18:53:44 +02:00
commit f46eab4b67

View file

@ -122,23 +122,16 @@ class Videoob(ReplApplication):
COPYRIGHT = 'Copyright(C) 2010 Christophe Benz, Romain Bignon, John Obbele' COPYRIGHT = 'Copyright(C) 2010 Christophe Benz, Romain Bignon, John Obbele'
CAPS = ICapVideo CAPS = ICapVideo
nsfw = True
videos = []
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
ReplApplication.__init__(self, *args, **kwargs) ReplApplication.__init__(self, *args, **kwargs)
try: try:
self.player = Player() self.player = Player()
except OSError: except OSError:
self.player = None self.player = None
self.videos = []
def add_application_options(self, group):
group.add_option('--nsfw', action='store_true', help='enable non-suitable for work videos')
def handle_application_options(self):
if self.options.backends:
self.options.nsfw = True
def _get_video(self, _id): def _get_video(self, _id):
if self.interactive: if self.interactive:
try: try:
@ -153,7 +146,6 @@ class Videoob(ReplApplication):
if video: if video:
return video return video
def _complete_id(self): def _complete_id(self):
return ['%s@%s' % (video.id, video.backend) for video in self.videos] return ['%s@%s' % (video.id, video.backend) for video in self.videos]
@ -229,7 +221,7 @@ class Videoob(ReplApplication):
else: else:
print 'Invalid argument "%s".' % line print 'Invalid argument "%s".' % line
else: else:
print "on" if self.options.nsfw else "off" print "on" if self.nsfw else "off"
def do_search(self, pattern=None): def do_search(self, pattern=None):
""" """