diff options
author | neodarz <neodarz@neodarz.net> | 2019-09-29 19:17:49 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2019-09-29 19:17:49 +0200 |
commit | edc11057e99ce2d69421f09fc5b6d94ca05b524c (patch) | |
tree | 2997b9c0c96e9dda49e0a73a363a040541a6f5e6 /db.py | |
parent | 970f944529fcf560710feedbaf194f963f2e4d9b (diff) | |
download | pyshaarli-edc11057e99ce2d69421f09fc5b6d94ca05b524c.tar.xz pyshaarli-edc11057e99ce2d69421f09fc5b6d94ca05b524c.zip |
Add function for removing an article
Diffstat (limited to 'db.py')
-rw-r--r-- | db.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -99,3 +99,12 @@ def bookmarks(path): for name in files: bookmarks.append(bookmark(path / Path(name))) return bookmarks + + +def remove(path): + path = Path(path) + try: + os.remove(path) + logging.info("{} removed".format(path.name)) + except FileNotFoundError: + logging.warning("{} doesn't exist!".format(path.name)) |