todo/todo/Note.py
2021-09-25 17:39:27 -04:00

18 lines
461 B
Python

from typing import Optional
from .TodoObject import TodoObject
class Note(TodoObject):
def __init__(self, level: int, text: str, parent: TodoObject = None, listed: bool = True):
self.listed = listed
super().__init__(level, text, parent)
def __str__(self):
if self.listed:
return f"- {self.text}"
else:
return self.text
def __add__(self, other: str):
return other + self.__str__()