Begin adding md parser

This commit is contained in:
2025-11-25 20:55:03 -05:00
parent ca237230e1
commit 3336973940
2 changed files with 22 additions and 2 deletions

View File

@@ -47,8 +47,11 @@ class Codupoc(App[None]):
todo.focus()
def insert_todo(self, title: str, scroller: VerticalScroll):
id = gen_random_base64(10)
self.todos[id] = { "title": title, "completed": False }
todo_id = gen_random_base64(10)
self.todos[todo_id] = { "title": title, "completed": False }
todo = TodoItem(self, title, id=todo_id)
scroller.mount(todo)
todo.focus()
def __init__(self):

17
codupoc/todomanager.py Normal file
View File

@@ -0,0 +1,17 @@
import sys
from os import path
class TodoManager:
filename = "todo.md"
def __init__(self):
self.file = None
def does_todo_file_exist(self):
return path.exists(self.filename)
def open_todo_file(self):
self.file = open(self.filename, "a")
return self.file
# Parse and save file as needed.