use cproperty from kython

This commit is contained in:
Dima Gerasimov 2019-03-14 20:38:34 +00:00
parent 63fd835386
commit 9f688cb50a

View file

@ -7,8 +7,8 @@ from pytz import UTC
from datetime import datetime
import os
from kython import group_by_key
from kython.misc import the
from kython import group_by_key, the, cproperty
_PATH = '/L/backups/hypothesis/'
@ -26,10 +26,6 @@ class Entry(NamedTuple):
hyp_link: str
# TODO kython??
cache = lru_cache()
cproperty = lambda f: property(cache(f))
class Page(NamedTuple):
highlights: Sequence[Entry]
@ -106,6 +102,13 @@ def get_todos():
return e.annotation.lstrip().lower().startswith('todo')
return list(filter(is_todo, get_entries()))
def test():
get_pages()
get_todos()
get_entries()
def _main():
for page in get_pages():
print(page)