@@ -843,13 +843,14 @@ def __init__(
843
843
) -> None :
844
844
"""__init__ method of PyStateContainer class."""
845
845
super ().__init__ ()
846
- self .service : DatamodelService = service
847
- self .rules = rules
848
- if path is None :
849
- self .path = []
850
- else :
851
- self .path = path
852
- self .cached_attrs = {}
846
+ self .__dict__ .update (
847
+ dict (
848
+ service = service ,
849
+ rules = rules ,
850
+ path = [] if path is None else path ,
851
+ cached_attrs = {},
852
+ )
853
+ )
853
854
854
855
def get_remote_state (self ) -> Any :
855
856
"""Get state of the current object."""
@@ -1791,13 +1792,16 @@ def __init__(
1791
1792
parent_arg ,
1792
1793
) -> None :
1793
1794
"""__init__ method of PyCommandArgumentsSubItem class."""
1794
- self .parent = parent
1795
- self .name = name
1796
-
1797
- self .service = service
1798
- self .rules = rules
1799
- self .path = path
1800
- self .parent_arg = parent_arg
1795
+ self .__dict__ .update (
1796
+ dict (
1797
+ parent = parent ,
1798
+ name = name ,
1799
+ service = service ,
1800
+ rules = rules ,
1801
+ path = path ,
1802
+ parent_arg = parent_arg ,
1803
+ )
1804
+ )
1801
1805
1802
1806
def get_state (self ) -> Any :
1803
1807
"""Get state of the command argument."""
@@ -1834,6 +1838,12 @@ def help(self) -> None:
1834
1838
"""Get help."""
1835
1839
pass
1836
1840
1841
+ def __setattr__ (self , key , value ):
1842
+ if isinstance (value , PyCommandArgumentsSubItem ):
1843
+ super ().__setattr__ (key , value )
1844
+ else :
1845
+ getattr (self , key ).set_state (value )
1846
+
1837
1847
1838
1848
class PyCommandArguments (PyStateContainer ):
1839
1849
"""Class representing command arguments in datamodel."""
@@ -1848,11 +1858,15 @@ def __init__(
1848
1858
static_info ,
1849
1859
) -> None :
1850
1860
"""__init__ method of PyCommandArguments class."""
1851
- self .static_info = static_info
1852
1861
super ().__init__ (service , rules , path )
1862
+ self .__dict__ .update (
1863
+ dict (
1864
+ static_info = static_info ,
1865
+ command = command ,
1866
+ id = id ,
1867
+ )
1868
+ )
1853
1869
self .path .append ((command , id ))
1854
- self .command = command
1855
- self .id = id
1856
1870
1857
1871
def __del__ (self ) -> None :
1858
1872
try :
@@ -1887,6 +1901,12 @@ def get_attr(self, attrib: str) -> Any:
1887
1901
"""
1888
1902
return self ._get_remote_attr (attrib )
1889
1903
1904
+ def __setattr__ (self , key , value ):
1905
+ if isinstance (value , PyCommandArgumentsSubItem ):
1906
+ super ().__setattr__ (key , value )
1907
+ else :
1908
+ getattr (self , key ).set_state (value )
1909
+
1890
1910
1891
1911
class PyTextualCommandArgumentsSubItem (PyCommandArgumentsSubItem , PyTextual ):
1892
1912
"""Class representing textual command argument in datamodel."""
0 commit comments