Begin adding md parser
This commit is contained in:
@@ -47,8 +47,11 @@ class Codupoc(App[None]):
|
|||||||
todo.focus()
|
todo.focus()
|
||||||
|
|
||||||
def insert_todo(self, title: str, scroller: VerticalScroll):
|
def insert_todo(self, title: str, scroller: VerticalScroll):
|
||||||
id = gen_random_base64(10)
|
todo_id = gen_random_base64(10)
|
||||||
self.todos[id] = { "title": title, "completed": False }
|
self.todos[todo_id] = { "title": title, "completed": False }
|
||||||
|
todo = TodoItem(self, title, id=todo_id)
|
||||||
|
scroller.mount(todo)
|
||||||
|
todo.focus()
|
||||||
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|||||||
17
codupoc/todomanager.py
Normal file
17
codupoc/todomanager.py
Normal 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.
|
||||||
Reference in New Issue
Block a user