pytreeconfig 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytreeconfig-0.1.0/PKG-INFO +5 -0
- pytreeconfig-0.1.0/pyproject.toml +6 -0
- pytreeconfig-0.1.0/pytreeconfig/__init__.py +0 -0
- pytreeconfig-0.1.0/pytreeconfig/base.py +31 -0
- pytreeconfig-0.1.0/pytreeconfig.egg-info/PKG-INFO +5 -0
- pytreeconfig-0.1.0/pytreeconfig.egg-info/SOURCES.txt +7 -0
- pytreeconfig-0.1.0/pytreeconfig.egg-info/dependency_links.txt +1 -0
- pytreeconfig-0.1.0/pytreeconfig.egg-info/top_level.txt +1 -0
- pytreeconfig-0.1.0/setup.cfg +4 -0
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from typing import Union
|
|
2
|
+
from copy import copy
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Node:
|
|
6
|
+
def __init__(self, node_id: str):
|
|
7
|
+
self._parent: Node | None = None
|
|
8
|
+
self._id = node_id
|
|
9
|
+
|
|
10
|
+
@property
|
|
11
|
+
def parent(self) -> Union['Node', None]:
|
|
12
|
+
return self._parent
|
|
13
|
+
|
|
14
|
+
@parent.setter
|
|
15
|
+
def parent(self, parent: Union['Node', None]) -> None:
|
|
16
|
+
self._parent = parent
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def id(self) -> str:
|
|
20
|
+
return self._id
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ContainerNode(Node):
|
|
25
|
+
def __init__(self, node_id: str):
|
|
26
|
+
super().__init__(node_id=node_id)
|
|
27
|
+
self._subnodes: dict[str, Node] = {}
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def subnodes(self) -> dict[str, Node]:
|
|
31
|
+
return copy(self._subnodes)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pytreeconfig
|