small performance improvement, error correction in handling of enclosures
This commit is contained in:
@ -69,11 +69,11 @@ class Entry(Base):
|
||||
if entry.has_key('enclosures') and len(entry.get('enclosures')) > 0:
|
||||
enclosures = ''
|
||||
for enclosure in entry.get('enclosures'):
|
||||
url = enclosure['href']
|
||||
length = size_human_readable(int(enclosure['length']))
|
||||
if not enclosures == '':
|
||||
enclosures += '\n'
|
||||
enclosures += '%s (%s)' % (url, length)
|
||||
enclosures += enclosure['href']
|
||||
if enclosure.has_key('length'):
|
||||
enclosures += ' (%s)' % size_human_readable(int(enclosure['length']))
|
||||
self.enclosures = enclosures
|
||||
if feed.resolveredirects:
|
||||
print ' fetching final link <%s>' % entry.link
|
||||
|
Reference in New Issue
Block a user