merge with upstream master
This commit is contained in:
16
helix/json_builder.py
Normal file
16
helix/json_builder.py
Normal file
@@ -0,0 +1,16 @@
|
||||
try:
|
||||
import ujson as json
|
||||
except ImportError:
|
||||
import json
|
||||
|
||||
|
||||
class JsonBuilder:
|
||||
def build_bom_output(self, rows):
|
||||
data = []
|
||||
headers = ['Part #', 'Description', 'Total']
|
||||
for row in rows:
|
||||
d = {}
|
||||
for i, value in enumerate(row):
|
||||
d[headers[i]] = value
|
||||
data.append(d)
|
||||
return json.dumps(data)
|
||||
Reference in New Issue
Block a user