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

Method _start_link

pattern/web/feed/feedparser.py:1538–1557  ·  view source on GitHub ↗
(self, attrsD)

Source from the content-addressed store, hash-verified

1536 self._getContext()['cloud'] = FeedParserDict(attrsD)
1537
1538 def _start_link(self, attrsD):
1539 attrsD.setdefault('rel', u'alternate')
1540 if attrsD['rel'] == u'self':
1541 attrsD.setdefault('type', u'application/atom+xml')
1542 else:
1543 attrsD.setdefault('type', u'text/html')
1544 context = self._getContext()
1545 attrsD = self._itsAnHrefDamnIt(attrsD)
1546 if 'href' in attrsD:
1547 attrsD['href'] = self.resolveURI(attrsD['href'])
1548 expectingText = self.infeed or self.inentry or self.insource
1549 context.setdefault('links', [])
1550 if not (self.inentry and self.inimage):
1551 context['links'].append(FeedParserDict(attrsD))
1552 if 'href' in attrsD:
1553 expectingText = 0
1554 if (attrsD.get('rel') == u'alternate') and (self.mapContentType(attrsD.get('type')) in self.html_types):
1555 context['link'] = attrsD['href']
1556 else:
1557 self.push('link', expectingText)
1558
1559 def _end_link(self):
1560 value = self.pop('link')

Callers 1

_cdf_commonMethod · 0.95

Calls 9

_getContextMethod · 0.95
_itsAnHrefDamnItMethod · 0.95
resolveURIMethod · 0.95
mapContentTypeMethod · 0.95
pushMethod · 0.95
FeedParserDictClass · 0.85
setdefaultMethod · 0.45
appendMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected