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

Function _parseMicroformats

pattern/web/feed/feedparser.py:2513–2526  ·  view source on GitHub ↗
(htmlSource, baseURI, encoding)

Source from the content-addressed store, hash-verified

2511 self.xfn.append({"relationships": xfn_rels, "href": elm.get('href', ''), "name": elm.string})
2512
2513def _parseMicroformats(htmlSource, baseURI, encoding):
2514 if not BeautifulSoup:
2515 return
2516 try:
2517 p = _MicroformatsParser(htmlSource, baseURI, encoding)
2518 except UnicodeEncodeError:
2519 # sgmllib throws this exception when performing lookups of tags
2520 # with non-ASCII characters in them.
2521 return
2522 p.vcard = p.findVCards(p.document)
2523 p.findTags()
2524 p.findEnclosures()
2525 p.findXFN()
2526 return {"tags": p.tags, "enclosures": p.enclosures, "xfn": p.xfn, "vcard": p.vcard}
2527
2528class _RelativeURIResolver(_BaseHTMLProcessor):
2529 relative_uris = set([('a', 'href'),

Callers 1

popMethod · 0.85

Calls 5

_MicroformatsParserClass · 0.85
findVCardsMethod · 0.80
findTagsMethod · 0.80
findEnclosuresMethod · 0.80
findXFNMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…