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,
|
def __init__(self,
|
||||||
id: Id,
|
id: Id,
|
||||||
parent_id: Optional[Id],
|
parent_id: Optional[Id],
|
||||||
children: Optional[List[Element]],
|
|
||||||
) -> None:
|
) -> None:
|
||||||
self._id = id
|
self._id = id
|
||||||
self._parent_id = id
|
self._parent_id = parent_id
|
||||||
|
|
||||||
self._children = children
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self) -> Id:
|
def id(self) -> Id:
|
||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def parent_id(self) -> Id:
|
def parent_id(self) -> Optional[Id]:
|
||||||
return self._parent_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
|
@abc.abstractmethod
|
||||||
def render(self,
|
def render(self,
|
||||||
width: int,
|
width: int,
|
||||||
depth: int,
|
depth: int,
|
||||||
highlighted: bool = False,
|
highlighted: bool = False,
|
||||||
folded: bool = False,
|
folded: bool = False,
|
||||||
) -> RenderedElement:
|
) -> "RenderedElement":
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class RenderedElement:
|
class RenderedElement:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue