Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -50,7 +50,7 @@ def make_tree(url1="",url2="",url3="",url4=""):
|
|
50 |
for line in spl:
|
51 |
spl2 = line.split(">")[0]
|
52 |
print(spl2)
|
53 |
-
if spl2.endswith('/"') or spl2.endswith('.json"'):
|
54 |
fin=line.split(">")[0].strip('""')
|
55 |
link_box.append(fin)
|
56 |
#html_out=html_out+html.replace("PAGE_LINK",fin)
|
@@ -91,13 +91,14 @@ with gr.Blocks() as app:
|
|
91 |
drop3=gr.Dropdown()
|
92 |
drop4=gr.Dropdown()
|
93 |
load_btn=gr.Button("Load JSON")
|
|
|
94 |
links=gr.JSON()
|
95 |
|
96 |
###### Images ##########
|
97 |
|
98 |
|
99 |
####### Raw ############
|
100 |
-
load_btn.click(load_json,[drop1,drop2,drop3,drop4],[
|
101 |
drop1.change(make_tree,drop1,[drop2])
|
102 |
drop2.change(make_tree,[drop1,drop2],[drop3])
|
103 |
drop3.change(make_tree,[drop1,drop2,drop3],[drop4])
|
|
|
50 |
for line in spl:
|
51 |
spl2 = line.split(">")[0]
|
52 |
print(spl2)
|
53 |
+
if spl2.endswith('/"') or spl2.endswith('.json"') or spl2.endswith('.png"') or spl2.endswith('.gif"') or spl2.endswith('.jpg"'):
|
54 |
fin=line.split(">")[0].strip('""')
|
55 |
link_box.append(fin)
|
56 |
#html_out=html_out+html.replace("PAGE_LINK",fin)
|
|
|
91 |
drop3=gr.Dropdown()
|
92 |
drop4=gr.Dropdown()
|
93 |
load_btn=gr.Button("Load JSON")
|
94 |
+
html_raw=gr.HTML()
|
95 |
links=gr.JSON()
|
96 |
|
97 |
###### Images ##########
|
98 |
|
99 |
|
100 |
####### Raw ############
|
101 |
+
load_btn.click(load_json,[drop1,drop2,drop3,drop4],[html_raw,links])
|
102 |
drop1.change(make_tree,drop1,[drop2])
|
103 |
drop2.change(make_tree,[drop1,drop2],[drop3])
|
104 |
drop3.change(make_tree,[drop1,drop2,drop3],[drop4])
|