aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-09-29 17:07:01 +0200
committerneodarz <neodarz@neodarz.net>2019-09-29 17:07:01 +0200
commit80bf52d7f96e92c96f36a01ef19e6637a9760c0f (patch)
treecf1bbb912959fdfb145ac56f06805b3e0f313cf0
parentd892b1c0b5a769ada9929907399dfde6a04d71c5 (diff)
downloadpyshaarli-80bf52d7f96e92c96f36a01ef19e6637a9760c0f.tar.xz
pyshaarli-80bf52d7f96e92c96f36a01ef19e6637a9760c0f.zip
Add function to get add articles
-rw-r--r--README.md2
-rw-r--r--db.py8
2 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index 5585894..6a62cee 100644
--- a/README.md
+++ b/README.md
@@ -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
diff --git a/db.py b/db.py
index 52df438..40de215 100644
--- a/db.py
+++ b/db.py
@@ -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