-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathpinboard.py
38 lines (25 loc) · 886 Bytes
/
pinboard.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""
[[https://pinboard.in][Pinboard]] bookmarks
"""
REQUIRES = [
'git+https://github.com/karlicoss/pinbexport',
]
from dataclasses import dataclass
from pathlib import Path
from typing import Iterator, Sequence
from my.core import get_files, Paths, Res
import my.config
import pinbexport.dal as pinbexport
@dataclass
class config(my.config.pinboard): # TODO rename to pinboard.pinbexport?
# TODO rename to export_path?
export_dir: Paths
# TODO not sure if should keep this import here?
Bookmark = pinbexport.Bookmark
def inputs() -> Sequence[Path]:
return get_files(config.export_dir)
# yep; clearly looks that the purpose of my. package is to wire files to DAL implicitly; otherwise it's just passtrhough.
def dal() -> pinbexport.DAL:
return pinbexport.DAL(inputs())
def bookmarks() -> Iterator[Res[pinbexport.Bookmark]]:
return dal().bookmarks()