From 9f688cb50ae7a8ddbfcef710dc71e246c9c2021c Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Thu, 14 Mar 2019 20:38:34 +0000 Subject: [PATCH] use cproperty from kython --- hypothesis/__init__.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hypothesis/__init__.py b/hypothesis/__init__.py index 774298c..f5e119b 100644 --- a/hypothesis/__init__.py +++ b/hypothesis/__init__.py @@ -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)