MCPcopy Index your code
hub / github.com/clips/pattern / isProbablyDownloadable

Method isProbablyDownloadable

pattern/web/feed/feedparser.py:2458–2471  ·  view source on GitHub ↗
(self, elm)

Source from the content-addressed store, hash-verified

2456 return sVCards.strip()
2457
2458 def isProbablyDownloadable(self, elm):
2459 attrsD = elm.attrMap
2460 if 'href' not in attrsD:
2461 return 0
2462 linktype = attrsD.get('type', '').strip()
2463 if linktype.startswith('audio/') or \
2464 linktype.startswith('video/') or \
2465 (linktype.startswith('application/') and not linktype.endswith('xml')):
2466 return 1
2467 path = urlparse.urlparse(attrsD['href'])[2]
2468 if path.find('.') == -1:
2469 return 0
2470 fileext = path.split('.').pop().lower()
2471 return fileext in self.known_binary_extensions
2472
2473 def findTags(self):
2474 all = lambda x: 1

Callers 1

findEnclosuresMethod · 0.95

Calls 5

stripMethod · 0.80
getMethod · 0.45
findMethod · 0.45
popMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected