Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyharrison committed Aug 17, 2023
1 parent 69e499c commit 4698539
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions sbom2doc/docbuilder/jsonbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@
class JSONBuilder(DocBuilder):
def __init__(self):
self.json_document = {}
self.element=["",""]
self.element_data=[]
self.element = ["", ""]
self.element_data = []
self.attribute_headings = []

def _attribute(self, name):
return name.lower().replace(" ","_")
return name.lower().replace(" ", "_")

def heading(self, level, title, number=True):
if self.element[level-1] != "":
self.json_document[self._attribute(self.element[level-1])] = self.element_data
self.element[level-1] = title
if self.element[level - 1] != "":
self.json_document[
self._attribute(self.element[level - 1])
] = self.element_data
self.element[level - 1] = title
self.element_data = []

def createtable(self, header, validate=None):
Expand All @@ -41,6 +43,6 @@ def addrow(self, data):

def publish(self, filename):
# Force last set of data to be added to document
self.heading(1,"dummy")
self.heading(1, "dummy")
json_doc = SBOMOutput(filename=filename, output_format="json")
json_doc.generate_output(self.json_document)

0 comments on commit 4698539

Please sign in to comment.