@@ -50,21 +50,6 @@ class Component:
5050 .. note::
5151 See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.3/#type_component
5252 """
53- _type : ComponentType
54- _package_url_type : str
55- _namespace : str
56- _name : str
57- _version : str
58- _qualifiers : str
59- _subpath : str
60-
61- _author : str = None
62- _description : str = None
63- _license : str = None
64-
65- _hashes : List [HashType ] = []
66- _vulnerabilites : List [Vulnerability ] = []
67- _external_references : List [ExternalReference ] = []
6853
6954 @staticmethod
7055 def for_file (absolute_file_path : str , path_for_bom : str = None ):
@@ -96,7 +81,7 @@ def for_file(absolute_file_path: str, path_for_bom: str = None):
9681 )
9782
9883 def __init__ (self , name : str , version : str , namespace : str = None , qualifiers : str = None , subpath : str = None ,
99- hashes : List [HashType ] = None ,
84+ hashes : List [HashType ] = None , author : str = None , description : str = None , license_str : str = None ,
10085 component_type : ComponentType = ComponentType .LIBRARY , package_url_type : str = 'pypi' ):
10186 self ._package_url_type = package_url_type
10287 self ._namespace = namespace
@@ -106,11 +91,13 @@ def __init__(self, name: str, version: str, namespace: str = None, qualifiers: s
10691 self ._qualifiers = qualifiers
10792 self ._subpath = subpath
10893
109- self ._hashes .clear ()
110- if hashes :
111- self ._hashes = hashes
112- self ._vulnerabilites .clear ()
113- self ._external_references .clear ()
94+ self ._author : str = author
95+ self ._description : str = description
96+ self ._license : str = license_str
97+
98+ self ._hashes : List [HashType ] = hashes if hashes else []
99+ self ._vulnerabilites : List [Vulnerability ] = []
100+ self ._external_references : List [ExternalReference ] = []
114101
115102 def add_external_reference (self , reference : ExternalReference ):
116103 """
@@ -122,15 +109,15 @@ def add_external_reference(self, reference: ExternalReference):
122109 """
123110 self ._external_references .append (reference )
124111
125- def add_hash (self , hash : HashType ):
112+ def add_hash (self , a_hash : HashType ):
126113 """
127114 Adds a hash that pins/identifies this Component.
128115
129116 Args:
130- hash :
117+ a_hash :
131118 `HashType` instance
132119 """
133- self ._hashes .append (hash )
120+ self ._hashes .append (a_hash )
134121
135122 def add_vulnerability (self , vulnerability : Vulnerability ):
136123 """
0 commit comments