Skip to content

Commit

Permalink
bc: remove parser API (#495)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <[email protected]>
  • Loading branch information
jkowalleck committed Nov 28, 2023
1 parent b10dc83 commit ac1f48a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 87 deletions.
19 changes: 0 additions & 19 deletions cyclonedx/model/bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from sortedcontainers import SortedSet

from ..exception.model import LicenseExpressionAlongWithOthersException, UnknownComponentDependencyException
from ..parser import BaseParser
from ..schema.schema import (
SchemaVersion1Dot0,
SchemaVersion1Dot1,
Expand Down Expand Up @@ -260,28 +259,10 @@ class Bom:
"""
This is our internal representation of a bill-of-materials (BOM).
You can either create a `cyclonedx.model.bom.Bom` yourself programmatically, or generate a `cyclonedx.model.bom.Bom`
from a `cyclonedx.parser.BaseParser` implementation.
Once you have an instance of `cyclonedx.model.bom.Bom`, you can pass this to an instance of
`cyclonedx.output.BaseOutput` to produce a CycloneDX document according to a specific schema version and format.
"""

@staticmethod
def from_parser(parser: BaseParser) -> 'Bom':
"""
Create a Bom instance from a Parser object.
Args:
parser (`cyclonedx.parser.BaseParser`): A valid parser instance.
Returns:
`cyclonedx.model.bom.Bom`: A Bom instance that represents the valid data held in the supplied parser.
"""
bom = Bom()
bom.components.update(parser.get_components())
return bom

def __init__(self, *, components: Optional[Iterable[Component]] = None,
services: Optional[Iterable[Service]] = None,
external_references: Optional[Iterable[ExternalReference]] = None,
Expand Down
68 changes: 0 additions & 68 deletions cyclonedx/parser/__init__.py

This file was deleted.

0 comments on commit ac1f48a

Please sign in to comment.