Skip to content

Commit 313c279

Browse files
committed
wip
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent da5e283 commit 313c279

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

cyclonedx/output/__init__.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ def _make_unique(self) -> str:
173173

174174
@classmethod
175175
def from_bom(cls, bom: 'Bom', prefix: str = 'BomRef') -> 'BomRefDiscriminator':
176+
"""
177+
Create an instance containing EVERY ``bom-ref`` in the bom.
178+
"""
179+
176180
components = tuple(bom._get_all_components())
177181
services = tuple(bom.services)
178182
vulnerabilities = tuple(bom.vulnerabilities)
@@ -200,17 +204,16 @@ def from_bom(cls, bom: 'Bom', prefix: str = 'BomRef') -> 'BomRefDiscriminator':
200204
else tuple(bom.definitions.standards)
201205
requirements: Iterable['Requirement'] = chain.from_iterable(s.requirements for s in standards)
202206
levels: Iterable['Level'] = chain.from_iterable(s.levels for s in standards)
203-
return cls(
204-
(i.bom_ref for i in chain(
205-
components,
206-
services,
207-
vulnerabilities,
208-
orgs,
209-
contacts,
210-
addresses,
211-
licenses,
212-
standards,
213-
requirements,
214-
levels,
215-
)),
216-
prefix)
207+
relevant_bom_refs: Iterable['BomRef'] = (i.bom_ref for i in chain(
208+
components,
209+
services,
210+
vulnerabilities,
211+
orgs,
212+
contacts,
213+
addresses,
214+
licenses,
215+
standards,
216+
requirements,
217+
levels,
218+
))
219+
return cls(relevant_bom_refs, prefix)

0 commit comments

Comments
 (0)