summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdatabase.py5
-rwxr-xr-xparser.py2
2 files changed, 6 insertions, 1 deletions
diff --git a/database.py b/database.py
index a6c6c77..31238c6 100755
--- a/database.py
+++ b/database.py
@@ -75,3 +75,8 @@ class Database:
SELECT id FROM categories WHERE name = ?
), ?, ?, datetime('now'));""", (category, title, markdown))
+ def update_thought_markdown(self, id_, markdown):
+ cursor = self.__connection.cursor()
+ cursor.execute("UPDATE thoughts SET markdown_text = ? WHERE id = ?;",
+ (markdown, id_))
+
diff --git a/parser.py b/parser.py
index db363f3..96085d4 100755
--- a/parser.py
+++ b/parser.py
@@ -155,7 +155,7 @@ def main():
print("Added thought.")
case "export":
with open(args["out"], "w") as f:
- f.writelines(db.get_thought(args["id"]))
+ f.writelines(db.get_thought(args["id"])[-3])
print(f"Written to {args["out"]}")
case "update":
with open(args["markdown"], "r") as f: