MCPcopy
hub / github.com/pyload/pyload / _parseMicroformats

Function _parseMicroformats

module/lib/feedparser.py:2408–2421  ·  view source on GitHub ↗
(htmlSource, baseURI, encoding)

Source from the content-addressed store, hash-verified

2406 self.xfn.append({"relationships": xfn_rels, "href": elm.get('href', ''), "name": elm.string})
2407
2408def _parseMicroformats(htmlSource, baseURI, encoding):
2409 if not BeautifulSoup: return
2410 if _debug: sys.stderr.write('entering _parseMicroformats\n')
2411 try:
2412 p = _MicroformatsParser(htmlSource, baseURI, encoding)
2413 except UnicodeEncodeError:
2414 # sgmllib throws this exception when performing lookups of tags
2415 # with non-ASCII characters in them.
2416 return
2417 p.vcard = p.findVCards(p.document)
2418 p.findTags()
2419 p.findEnclosures()
2420 p.findXFN()
2421 return {"tags": p.tags, "enclosures": p.enclosures, "xfn": p.xfn, "vcard": p.vcard}
2422
2423class _RelativeURIResolver(_BaseHTMLProcessor):
2424 relative_uris = [('a', 'href'),

Callers 1

popMethod · 0.85

Calls 6

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

Tested by

no test coverage detected