Interactive/DisableYouTube.py

#-
# (C) Copyright 2012 Autodesk, Inc.  All rights reserved.
#
# This computer source code and related instructions and comments are
# the unpublished confidential and proprietary information of
# Autodesk, Inc. and are protected under applicable copyright and
# trade secret law.  They may not be disclosed to, copied or used by
# any third party without the prior written consent of Autodesk, Inc.
#+


# OBSOLETE: Please use SHOWCASE_YOUTUBE_DISABLE environment variable
# set to True, to disable and remove YouTube functionality from Showcase.

from UserCustomization  import UserCustomBase
from RTFapi             import SystemInformation
from YouTube            import kYouTubeAPIAvailable

class NoYouTube( UserCustomBase ):
    def __init__( self ):
        if not kYouTubeAPIAvailable:
            return
        title = _("Obsolete add-in %s") % ("DisableYouTube")
        message=_("To disable YouTube functionality, set environment variable\nSHOWCASE_YOUTUBE_DISABLE to 1.")
        self.sendMessage( 'UI_CONFIRM_DIALOG', ( title, message, '' ) )

def instantiate():
    return NoYouTube()