general: use less explicit kompress boilerplate in modules
now get_files/kompress library can handle it transparently
This commit is contained in:
parent
c63e80ce94
commit
8c2d1c9463
9 changed files with 14 additions and 19 deletions
|
@ -146,12 +146,11 @@ class TakeoutHTMLParser(HTMLParser):
|
|||
|
||||
|
||||
def read_html(tpath: Path, file: str) -> Iterable[Parsed]:
|
||||
from ...core.kompress import kopen
|
||||
results: List[Parsed] = []
|
||||
def cb(dt: datetime, url: Url, title: Title) -> None:
|
||||
results.append((dt, url, title))
|
||||
parser = TakeoutHTMLParser(callback=cb)
|
||||
with kopen(tpath, file) as fo:
|
||||
with (tpath / file).open() as fo:
|
||||
data = fo.read()
|
||||
parser.feed(data)
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue