diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | db.py | 8 |
2 files changed, 9 insertions, 1 deletions
@@ -13,7 +13,7 @@ Just simple, databaseless, static, shaarli like system link sharing. Fonctionalities: [ ] Flat file system management [X] Get an article - [ ] Get all articles + [X] Get all articles [ ] Get `n` articles from a range [ ] Add an article [ ] Delete an article @@ -87,3 +87,11 @@ def bookmark(path): bookmark["private"] = [m.group(1) for l in lines for m in [private.search(l)] if m][0] bookmark["comment"] = [m.group(1) for m in [comment.search("".join(lines))] if m][0] return bookmark + + +def bookmarks(path): + bookmarks = [] + for root, dirs, files in os.walk(path, topdown=False): + for name in files: + bookmarks.append(bookmark(path / Path(name))) + return bookmarks |