renamed to loft service to be more clear, added solution file generation naming via regex, few qol things

This commit is contained in:
Josh Burman
2021-10-29 00:10:30 +00:00
parent 3a42d83b76
commit d13574ac08
4 changed files with 20 additions and 11 deletions

View File

@ -1,5 +1,6 @@
import csv
import io
import re
def items_csv_to_dict(items_csv_reader):
items = []
@ -15,6 +16,8 @@ def items_csv_to_dict(items_csv_reader):
for key, col in enumerate(headers):
if key == 0:
item[col] = row[key]
elif col == 'b_param':
item[col] = row[key]
elif key > 1:
item['attributes'].append({
'id': col,
@ -43,3 +46,6 @@ def solution_to_file(buffer, total_form_items, forms):
buff2 = io.BytesIO(buffer.getvalue().encode())
return buff2
def key_to_uuid(key):
return re.split("_", key)[0]