14 lines
502 B
Python
14 lines
502 B
Python
|
from pathlib import Path
|
||
|
import sqlite3
|
||
|
|
||
|
|
||
|
def import_from_buku(store, buku_path: Path = None):
|
||
|
if buku_path is None:
|
||
|
buku_path = Path('~/.local/share/buku/bookmarks.db').expanduser()
|
||
|
conn = sqlite3.connect(buku_path)
|
||
|
cur = conn.cursor()
|
||
|
query = '''SELECT URL, metadata, tags, desc FROM bookmarks'''
|
||
|
for url, title, tags, desc in cur.execute(query):
|
||
|
tags = [t.strip() for t in tags.split(',')]
|
||
|
store.add('', url=url, title=title, tags=tags, description=desc)
|