HPI/my/instapaper.py
2020-05-03 10:08:53 +01:00

32 lines
607 B
Python

"""
Instapaper bookmarks, highlights and annotations
"""
from .common import get_files
from my.config import instapaper as config
import my.config.repos.instapexport.dal as dal
Highlight = dal.Highlight
Bookmark = dal.Bookmark
def inputs():
return get_files(config.export_path, glob='*.json')
def _dal() -> dal.DAL:
return dal.DAL(inputs())
def pages():
return _dal().pages()
get_pages = pages # todo also deprecate..
# TODO dunno, move this to private?
def is_todo(hl: Highlight) -> bool:
note = hl.note or ''
note = note.lstrip().lower()
return note.startswith('todo')