django_youtube/api.py
def _access_control(self, access_control, my_media_group=None):
        """
        Prepares the extension element for access control
        Extension element is the optional parameter for the YouTubeVideoEntry
        We use extension element to modify access control settings

        Returns:
            tuple of extension elements
        """
        # Access control
        extension = None
        if access_control is AccessControl.Private:
            # WARNING: this part of code is not tested
            # set video as private
            if my_media_group:
                my_media_group.private = gdata.media.Private()
        elif access_control is AccessControl.Unlisted:
            # set video as unlisted
            from gdata.media import YOUTUBE_NAMESPACE
            from atom import ExtensionElement
            kwargs = {
                "namespace": YOUTUBE_NAMESPACE,
                "attributes": {'action': 'list', 'permission': 'denied'},
            }
            extension = ([ExtensionElement('accessControl', **kwargs)])
        return extension
def _access_control(self, access_control, my_media_group=None):
        # Access control
        extension = None
        if access_control is AccessControl.Private:
            # WARNING: this part of code is not tested
            # set video as private
            if my_media_group:
                my_media_group.private = gdata.media.Private()
        elif access_control is AccessControl.Unlisted:
            # set video as unlisted
            from gdata.media import YOUTUBE_NAMESPACE
            from atom import ExtensionElement
            kwargs = {
                "namespace": YOUTUBE_NAMESPACE,
                "attributes": {'action': 'list', 'permission': 'denied'},
            }
            extension = ([ExtensionElement('accessControl', **kwargs)])
        return extension
def _access_control ( self , access_control , my_media_group = None ) : # Access control extension = None if access_control is AccessControl . Private : # WARNING: this part of code is not tested # set video as private if my_media_group : my_media_group . private = gdata . media . Private ( ) elif access_control is AccessControl . Unlisted : # set video as unlisted from gdata . media import YOUTUBE_NAMESPACE from atom import ExtensionElement kwargs = { "namespace" : YOUTUBE_NAMESPACE , "attributes" : { 'action' : 'list' , 'permission' : 'denied' } , } extension = ( [ ExtensionElement ( 'accessControl' , * * kwargs ) ] ) return extension
Prepares the extension element for access control
        Extension element is the optional parameter for the YouTubeVideoEntry
        We use extension element to modify access control settings

        Returns:
            tuple of extension elements
Prepares the extension element for access control Extension element is the optional parameter for the YouTubeVideoEntry We use extension element to modify access control settings