Fix parsing regex and stringifier for Todos
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import re
|
||||
|
||||
from todo import Todo
|
||||
from .todo import Todo
|
||||
|
||||
TODO_PATTERN = r"^- \[( |X)\] (.+)$"
|
||||
|
||||
|
||||
@@ -8,4 +8,5 @@ class Todo:
|
||||
self.lid = gen_random_base64(10)
|
||||
|
||||
def __str__(self):
|
||||
return f"- [{self.checked}] {self.item}"
|
||||
checkmark = "X" if self.checked else " "
|
||||
return f"- [{checkmark}] {self.item}"
|
||||
Reference in New Issue
Block a user