Spaces:
Running
on
Zero
Running
on
Zero
kwabs22
commited on
Commit
·
d58ed4c
1
Parent(s):
edefa8c
Refactor Proto Assist accordion to absorb mess
Browse files
app.py
CHANGED
@@ -364,14 +364,15 @@ 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)
|
368 |
|
369 |
update_button = gr.Button("Update JSON")
|
370 |
json_output = gr.Textbox(label="Updated JSON", lines=10)
|
|
|
|
|
|
|
371 |
|
372 |
-
update_button
|
373 |
-
|
374 |
-
return outputs + [update_button, json_output]
|
375 |
|
376 |
def create_media_component(file_path):
|
377 |
print(file_path)
|
@@ -1003,7 +1004,8 @@ Creating more diverse paths through the game""")
|
|
1003 |
gr.HTML("Placeholder for clearing uploaded assets (public space and temporary persistence = sharing and space problems)")
|
1004 |
with gr.Accordion("My Previous Quick Config Attempts", open=False):
|
1005 |
for experimetal_config_name, experimetal_config in ExampleGameConfigs.items():
|
1006 |
-
gr.
|
|
|
1007 |
|
1008 |
with gr.Tab("Test and Edit Config"):
|
1009 |
gr.HTML("The main issue is frequent changes add more chances for bugs in how - manual and auto refer mainly to ensuring correct JSON format ")
|
|
|
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 |
|
375 |
+
return outputs + [update_button, json_output, json_output_code]
|
|
|
|
|
376 |
|
377 |
def create_media_component(file_path):
|
378 |
print(file_path)
|
|
|
1004 |
gr.HTML("Placeholder for clearing uploaded assets (public space and temporary persistence = sharing and space problems)")
|
1005 |
with gr.Accordion("My Previous Quick Config Attempts", open=False):
|
1006 |
for experimetal_config_name, experimetal_config in ExampleGameConfigs.items():
|
1007 |
+
with gr.Tab(experimetal_config_name):
|
1008 |
+
gr.Code(json.dumps(experimetal_config, default=lambda o: o.__dict__, indent=2), label=experimetal_config_name) #str(experimetal_config)
|
1009 |
|
1010 |
with gr.Tab("Test and Edit Config"):
|
1011 |
gr.HTML("The main issue is frequent changes add more chances for bugs in how - manual and auto refer mainly to ensuring correct JSON format ")
|