kwabs22 commited on
Commit
f658ac0
·
1 Parent(s): f09bd3c

Refactor Proto Assist accordion to absorb mess

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -354,12 +354,12 @@ def show_elements_json_input(json_input):
354
  print(locations)
355
  for i, location in enumerate(locations):
356
  updated_data["masterlocation1"][location] = {
357
- "description": current_values[i*5],
358
- "events": json.loads(current_values[i*5 + 1]),
359
- "choices": json.loads(current_values[i*5 + 2]),
360
- "transitions": json.loads(current_values[i*5 + 3]),
361
- "media": json.loads(current_values[i*5 + 4]), # New media field
362
- "developernotes": json.loads(current_values[i*5 + 5])
363
  }
364
  updated_data["masterlocation1"]["end"] = masterlocation1["end"]
365
  return json.dumps(updated_data, indent=2)
 
354
  print(locations)
355
  for i, location in enumerate(locations):
356
  updated_data["masterlocation1"][location] = {
357
+ "description": current_values[i*6],
358
+ "events": json.loads(current_values[i*6 + 1]),
359
+ "choices": json.loads(current_values[i*6 + 2]),
360
+ "transitions": json.loads(current_values[i*6 + 3]),
361
+ "media": json.loads(current_values[i*6 + 4]), # New media field
362
+ "developernotes": json.loads(current_values[i*6 + 5])
363
  }
364
  updated_data["masterlocation1"]["end"] = masterlocation1["end"]
365
  return json.dumps(updated_data, indent=2)