kwabs22 commited on
Commit
64073bc
·
1 Parent(s): d58ed4c

Refactor Proto Assist accordion to absorb mess

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -364,11 +364,11 @@ def show_elements_json_input(json_input):
364
  "developernotes": json.loads(current_values[i*num_current_unique_fields + 5])
365
  }
366
  updated_data["masterlocation1"]["end"] = masterlocation1["end"]
367
- return json.dumps(updated_data, indent=2), json.dumps(updated_data, indent=2)
368
 
369
  update_button = gr.Button("Update JSON")
370
  json_output = gr.Textbox(label="Updated JSON", lines=10)
371
- json_output_code = gr.Code()
372
 
373
  update_button.click(update_json, inputs=outputs, outputs=[json_output, json_output_code])
374
 
 
364
  "developernotes": json.loads(current_values[i*num_current_unique_fields + 5])
365
  }
366
  updated_data["masterlocation1"]["end"] = masterlocation1["end"]
367
+ return json.dumps(updated_data, indent=2), json.dumps(updated_data, default=lambda o: o.__dict__, indent=2)
368
 
369
  update_button = gr.Button("Update JSON")
370
  json_output = gr.Textbox(label="Updated JSON", lines=10)
371
+ json_output_code = gr.Code(lines=10)
372
 
373
  update_button.click(update_json, inputs=outputs, outputs=[json_output, json_output_code])
374