def check_complicance(self):
        """Check compliance with Media RSS Specification, Version 1.5.1.

        see http://www.rssboard.org/media-rss
        Raises AttributeError on error.
        """
        # check Media RSS requirement: one of the following elements is
        # required: media_group | media_content | media_player | media_peerLink
        # | media_location. We do the check only if any media_... element is
        # set to allow non media feeds
        if(any([ma for ma in vars(self)
                if ma.startswith('media_') and getattr(self, ma)])
           and not self.media_group
           and not self.media_content
           and not self.media_player
           and not self.media_peerLink
           and not self.media_location
           ):
            raise AttributeError(
                "Using media elements requires the specification of at least "
                "one of the following elements: 'media_group', "
                "'media_content', 'media_player', 'media_peerLink' or "
                "'media_location'.")

        # check Media RSS requirement: if media:player is missing all
        # media_content elements need to have url attributes.
        if not self.media_player:
            if self.media_content:
                # check if all media_content elements have a URL set
                if isinstance(self.media_content, list):
                    if not all([False for mc in self.media_content if
                                'url' not in mc.element_attrs]):
                        raise AttributeError(
                            "MediaRSSItems require a media_player attribute "
                            "if a media_content has no url set.")
                else:
                    if not self.media_content.element_attrs['url']:
                        raise AttributeError(
                            "MediaRSSItems require a media_player attribute "
                            "if a media_content has no url set.")
                pass
            elif self.media_group:
                # check media groups without player if its media_content
                # elements have a URL set
                raise NotImplementedError(
                    "MediaRSSItem: media_group check not implemented yet.")
def check_complicance ( self ) : if ( any ( [ ma for ma in vars ( self ) if ma . startswith ( 'media_' ) and getattr ( self , ma ) ] ) and not self . media_group and not self . media_content and not self . media_player and not self . media_peerLink and not self . media_location ) : raise AttributeError ( "Using media elements requires the specification of at least " "one of the following elements: 'media_group', " "'media_content', 'media_player', 'media_peerLink' or " "'media_location'." ) if not self . media_player : if self . media_content : if isinstance ( self . media_content , list ) : if not all ( [ False for mc in self . media_content if 'url' not in mc . element_attrs ] ) : raise AttributeError ( "MediaRSSItems require a media_player attribute " "if a media_content has no url set." ) else : if not self . media_content . element_attrs [ 'url' ] : raise AttributeError ( "MediaRSSItems require a media_player attribute " "if a media_content has no url set." ) pass elif self . media_group : raise NotImplementedError ( "MediaRSSItem: media_group check not implemented yet." )
Check compliance with Media RSS Specification, Version 1.5.1.

        see http://www.rssboard.org/media-rss
        Raises AttributeError on error.