Remove obsolete attributes
This commit is contained in:
parent
a4a171105b
commit
603f8253cf
1 changed files with 3 additions and 16 deletions
|
|
@ -12,39 +12,26 @@ class Element(abc.ABC):
|
|||
def __init__(self,
|
||||
id: Id,
|
||||
parent_id: Optional[Id],
|
||||
children: Optional[List[Element]],
|
||||
) -> None:
|
||||
self._id = id
|
||||
self._parent_id = id
|
||||
self._parent_id = parent_id
|
||||
|
||||
self._children = children
|
||||
|
||||
@property
|
||||
def id(self) -> Id:
|
||||
return self._id
|
||||
|
||||
@property
|
||||
def parent_id(self) -> Id:
|
||||
def parent_id(self) -> Optional[Id]:
|
||||
return self._parent_id
|
||||
|
||||
@property
|
||||
def children(self) -> List[Element]:
|
||||
if self._children is None:
|
||||
raise ElementException("Element doesn't know its children")
|
||||
|
||||
return self._children
|
||||
|
||||
@children.setter
|
||||
def children(self, children: List[Element]) -> None:
|
||||
self._children = children
|
||||
|
||||
@abc.abstractmethod
|
||||
def render(self,
|
||||
width: int,
|
||||
depth: int,
|
||||
highlighted: bool = False,
|
||||
folded: bool = False,
|
||||
) -> RenderedElement:
|
||||
) -> "RenderedElement":
|
||||
pass
|
||||
|
||||
class RenderedElement:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue