(self, link=None, replace=False, **kwargs)
return self.__atom_link
Get or set link data. An link element is a dict with the fields
        href, rel, type, hreflang, title, and length. Href is mandatory for
        ATOM.

        This method can be called with:
        - the fields of a link as keyword arguments
        - the fields of a link as a dictionary
        - a list of dictionaries containing the link fields

        A link has the following fields:

        - *href* is the URI of the referenced resource (typically a Web page)
        - *rel* contains a single link relationship type. It can be a full URI,
          or one of the following predefined values (default=alternate):

            - *alternate* an alternate representation of the entry or feed, for
              example a permalink to the html version of the entry, or the
              front page of the weblog.
            - *enclosure* a related resource which is potentially large in size
              and might require special handling, for example an audio or video
              recording.
            - *related* an document related to the entry or feed.
            - *self* the feed itself.
            - *via* the source of the information provided in the entry.

        - *type* indicates the media type of the resource.
        - *hreflang* indicates the language of the referenced resource.
        - *title* human readable information about the link, typically for
          display purposes.
        - *length* the length of the resource, in bytes.

        RSS only supports one link with nothing but a URL. So for the RSS link
        element the last link with rel=alternate is used.

        RSS also supports one enclusure element per entry which is covered by
        the link element in ATOM feed entries. So for the RSS enclusure element
        the last link with rel=enclosure is used.

        :param link:    Dict or list of dicts with data.
        :param replace: Add or replace old data.
        :returns: List of link data.
Get or set link data. An link element is a dict with the fields
        href, rel, type, hreflang, title, and length. Href is mandatory for
        ATOM.
Get or set link data . An link element is a dict with the fields href rel type hreflang title and length . Href is mandatory for ATOM .
def link(self, link=None, replace=False, **kwargs):
        '''Get or set link data. An link element is a dict with the fields
        href, rel, type, hreflang, title, and length. Href is mandatory for
        ATOM.

        This method can be called with:
        - the fields of a link as keyword arguments
        - the fields of a link as a dictionary
        - a list of dictionaries containing the link fields

        A link has the following fields:

        - *href* is the URI of the referenced resource (typically a Web page)
        - *rel* contains a single link relationship type. It can be a full URI,
          or one of the following predefined values (default=alternate):

            - *alternate* an alternate representation of the entry or feed, for
              example a permalink to the html version of the entry, or the
              front page of the weblog.
            - *enclosure* a related resource which is potentially large in size
              and might require special handling, for example an audio or video
              recording.
            - *related* an document related to the entry or feed.
            - *self* the feed itself.
            - *via* the source of the information provided in the entry.

        - *type* indicates the media type of the resource.
        - *hreflang* indicates the language of the referenced resource.
        - *title* human readable information about the link, typically for
          display purposes.
        - *length* the length of the resource, in bytes.

        RSS only supports one link with nothing but a URL. So for the RSS link
        element the last link with rel=alternate is used.

        RSS also supports one enclusure element per entry which is covered by
        the link element in ATOM feed entries. So for the RSS enclusure element
        the last link with rel=enclosure is used.

        :param link:    Dict or list of dicts with data.
        :param replace: Add or replace old data.
        :returns: List of link data.
        '''
        if link is None and kwargs:
            link = kwargs
        if link is not None:
            if replace or self.__atom_link is None:
                self.__atom_link = []
            self.__atom_link += ensure_format(
                link,
                set(['href', 'rel', 'type', 'hreflang', 'title', 'length']),
                set(['href']),
                {'rel': ['alternate', 'enclosure', 'related', 'self', 'via']},
                {'rel': 'alternate'})
            # RSS only needs one URL. We use the first link for RSS:
            for l in self.__atom_link:
                if l.get('rel') == 'alternate':
                    self.__rss_link = l['href']
                elif l.get('rel') == 'enclosure':
                    self.__rss_enclosure = {'url': l['href']}
                    self.__rss_enclosure['type'] = l.get('type')
                    self.__rss_enclosure['length'] = l.get('length') or '0'
        # return the set with more information (atom)
        return self.__atom_link
def link ( self , link = None , replace = False , * * kwargs ) : if link is None and kwargs : link = kwargs if link is not None : if replace or self . __atom_link is None : self . __atom_link = [ ] self . __atom_link += ensure_format ( link , set ( [ 'href' , 'rel' , 'type' , 'hreflang' , 'title' , 'length' ] ) , set ( [ 'href' ] ) , { 'rel' : [ 'alternate' , 'enclosure' , 'related' , 'self' , 'via' ] } , { 'rel' : 'alternate' } ) # RSS only needs one URL. We use the first link for RSS: for l in self . __atom_link : if l . get ( 'rel' ) == 'alternate' : self . __rss_link = l [ 'href' ] elif l . get ( 'rel' ) == 'enclosure' : self . __rss_enclosure = { 'url' : l [ 'href' ] } self . __rss_enclosure [ 'type' ] = l . get ( 'type' ) self . __rss_enclosure [ 'length' ] = l . get ( 'length' ) or '0' # return the set with more information (atom) return self . __atom_link