fix mypy
This commit is contained in:
parent
c6a5a9d9bd
commit
9380a4e8e2
1 changed files with 8 additions and 9 deletions
|
@ -6,6 +6,7 @@ import json
|
||||||
|
|
||||||
from kython.kerror import ResT, echain, unwrap, sort_res_by
|
from kython.kerror import ResT, echain, unwrap, sort_res_by
|
||||||
from kython.klogging import setup_logzero
|
from kython.klogging import setup_logzero
|
||||||
|
from kython.konsume import wrap, zoom, ignore
|
||||||
|
|
||||||
|
|
||||||
BDIR = Path('/L/zzz_syncthing/data/.polar')
|
BDIR = Path('/L/zzz_syncthing/data/.polar')
|
||||||
|
@ -52,7 +53,6 @@ class Book(NamedTuple):
|
||||||
title: Optional[str]
|
title: Optional[str]
|
||||||
items: Sequence[Highlight]
|
items: Sequence[Highlight]
|
||||||
|
|
||||||
from kython.konsume import zoom, akeq
|
|
||||||
|
|
||||||
class Loader:
|
class Loader:
|
||||||
def __init__(self, p: Path) -> None:
|
def __init__(self, p: Path) -> None:
|
||||||
|
@ -144,7 +144,6 @@ class Loader:
|
||||||
|
|
||||||
|
|
||||||
def load_items(self, metas) -> Iterator[Highlight]:
|
def load_items(self, metas) -> Iterator[Highlight]:
|
||||||
from kython.konsume import wrap
|
|
||||||
for p, meta in metas.items():
|
for p, meta in metas.items():
|
||||||
with wrap(meta) as meta:
|
with wrap(meta) as meta:
|
||||||
yield from self.load_item(meta)
|
yield from self.load_item(meta)
|
||||||
|
@ -199,13 +198,13 @@ def main():
|
||||||
|
|
||||||
for entry in iter_entries():
|
for entry in iter_entries():
|
||||||
logger.info('processed %s', entry.uid)
|
logger.info('processed %s', entry.uid)
|
||||||
for i in entry.items:
|
|
||||||
try:
|
try:
|
||||||
ii = unwrap(i)
|
ee = unwrap(entry)
|
||||||
except Error as e:
|
except Error as e:
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
else:
|
else:
|
||||||
logger.info(ii)
|
for i in ee.items:
|
||||||
|
logger.info(i)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Add table
Reference in a new issue