Skip to content

Commit 36fff0e

Browse files
committed
Added __delitem__ on FileSet.
1 parent bd45b06 commit 36fff0e

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

pyEDAA/ProjectModel/__init__.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -935,14 +935,14 @@ def Validate(self) -> None:
935935

936936
def __len__(self) -> int:
937937
"""
938-
Returns number of attributes set on the file set.
938+
Returns number of attributes set on the fileset.
939939
940940
:returns: The number if attributes set on that fileset.
941941
"""
942942
return len(self._attributes)
943943

944944
def __getitem__(self, key: Type[Attribute]) -> Any:
945-
"""Index access for returning attributes on this file.
945+
"""Index access for returning attributes on this fileset.
946946
947947
:param key: The attribute type.
948948
:returns: The attribute's value.
@@ -958,7 +958,7 @@ def __getitem__(self, key: Type[Attribute]) -> Any:
958958

959959
def __setitem__(self, key: Type[Attribute], value: typing_Any) -> None:
960960
"""
961-
Index access for setting attributes on this file.
961+
Index access for adding or setting attributes on this fileset.
962962
963963
:param key: The attribute type.
964964
:param value: The attributes value.
@@ -969,6 +969,17 @@ def __setitem__(self, key: Type[Attribute], value: typing_Any) -> None:
969969

970970
self._attributes[key] = value
971971

972+
def __delitem__(self, key: Type[Attribute]) -> None:
973+
"""
974+
Index access for delting attributes on this fileset.
975+
976+
:param key: The attribute type.
977+
"""
978+
if not issubclass(key, Attribute):
979+
raise TypeError("Parameter 'key' is not an 'Attribute'.")
980+
981+
del self._attributes[key]
982+
972983
def GetOrCreateVHDLLibrary(self, name) -> None:
973984
if name in self._vhdlLibraries:
974985
return self._vhdlLibraries[name]

0 commit comments

Comments
 (0)