merging with upstream
This commit is contained in:
@@ -5,12 +5,18 @@ except ImportError:
|
||||
|
||||
|
||||
class JsonBuilder:
|
||||
def build_bom_output(self, rows):
|
||||
def build_bom(self, rows):
|
||||
data = []
|
||||
headers = ['Part #', 'Description', 'Total']
|
||||
headers = ['itemId', 'description', 'quantity']
|
||||
for row in rows:
|
||||
d = {}
|
||||
for i, value in enumerate(row):
|
||||
d[headers[i]] = value
|
||||
data.append(d)
|
||||
return data
|
||||
|
||||
def bom_to_json(self, data):
|
||||
return json.dumps(data)
|
||||
|
||||
def build_bom_output(self, rows):
|
||||
return self.bom_to_json(self.build_bom(rows))
|
||||
|
||||
Reference in New Issue
Block a user