MCPcopy
hub / github.com/pyload/pyload / feed

Method feed

module/lib/feedparser.py:1837–1852  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

1835 return j
1836
1837 def feed(self, data):
1838 data = re.compile(r'<!((?!DOCTYPE|--|\[))', re.IGNORECASE).sub(r'&lt;!\1', data)
1839 #data = re.sub(r'<(\S+?)\s*?/>', self._shorttag_replace, data) # bug [ 1399464 ] Bad regexp for _shorttag_replace
1840 data = re.sub(r'<([^<>\s]+?)\s*/>', self._shorttag_replace, data)
1841 data = data.replace('&#39;', "'")
1842 data = data.replace('&#34;', '"')
1843 try:
1844 bytes
1845 if bytes is str:
1846 raise NameError
1847 self.encoding = self.encoding + '_INVALID_PYTHON_3'
1848 except NameError:
1849 if self.encoding and type(data) == type(u''):
1850 data = data.encode(self.encoding)
1851 sgmllib.SGMLParser.feed(self, data)
1852 sgmllib.SGMLParser.close(self)
1853
1854 def normalize_attrs(self, attrs):
1855 if not attrs: return attrs

Callers 4

_resolveRelativeURIsFunction · 0.80
_sanitizeHTMLFunction · 0.80
parseFunction · 0.80
_feedMethod · 0.80

Calls 4

compileMethod · 0.80
replaceMethod · 0.45
encodeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected