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