'Stores information from an rss enclosure into an Entry.'

def add_enclosure_info(self, entry, enclosure, filename=True, multiple=False):

    entry[u'url'] = enclosure[u'href']
    if (u'length' in enclosure):
        try:
            entry[u'size'] = int(enclosure[u'length'])
        except ValueError:
            entry[u'size'] = 0
    if (u'type' in enclosure):
        entry[u'type'] = enclosure[u'type']
    basename = posixpath.basename(urlsplit(entry[u'url']).path)
    if ((entry.get(u'size') or (multiple and basename)) and filename):
        entry[u'filename'] = basename
        log.trace(u'filename    `%s`    from    enclosure', entry[u'filename'])
