Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -90,16 +90,20 @@ def upd_drop(lvl_1=None,lvl_2=None,lvl_3=None,lvl_4=None,lvl_5=None,fetch_url=""
|
|
90 |
print (f'lvl_3 ::: {lvl_3}')
|
91 |
print (f'lvl_4 ::: {lvl_4}')
|
92 |
print (f'lvl_5 ::: {lvl_5}')
|
93 |
-
|
94 |
if lvl_1 == "rows":
|
95 |
lvl_src= out_json[lvl_1][0]
|
96 |
else:
|
97 |
lvl_src=out_json[lvl_1]
|
98 |
print (f"lvl_src:: {lvl_src}")
|
|
|
99 |
if lvl_1 !=[]:
|
100 |
for ea in (lvl_src):
|
101 |
box_1.append(ea)
|
102 |
out= gr.update(choices = [m for m in box_1])
|
|
|
|
|
|
|
103 |
if lvl_2 !=[]:
|
104 |
for ea in (lvl_src[lvl_2]):
|
105 |
print (ea)
|
@@ -107,21 +111,24 @@ def upd_drop(lvl_1=None,lvl_2=None,lvl_3=None,lvl_4=None,lvl_5=None,fetch_url=""
|
|
107 |
out= gr.update(choices = [m for m in box_2])
|
108 |
else:
|
109 |
pass
|
|
|
|
|
|
|
110 |
if lvl_3 !=[]:
|
111 |
for ea in (lvl_src[lvl_2][lvl_3]):
|
112 |
box_3.append(ea)
|
113 |
out= gr.update(choices = [m for m in box_3])
|
114 |
else:
|
115 |
pass
|
|
|
|
|
|
|
116 |
if lvl_4 !=[]:
|
117 |
for ea in (lvl_src[lvl_2][lvl_3][lvl_4]):
|
118 |
box_4.append(ea)
|
119 |
out= gr.update(choices = [m for m in box_4])
|
120 |
else:
|
121 |
pass
|
122 |
-
except Exception:
|
123 |
-
out = []
|
124 |
-
pass
|
125 |
return out
|
126 |
def find_items(lvl_1,lvl_2,lvl_3,lvl_4,lvl_5,fetch_url,config="TEST",split="test",offset=0,length=10):
|
127 |
out_json,_=query2(fetch_url,config,split,offset=10,length=20)
|
|
|
90 |
print (f'lvl_3 ::: {lvl_3}')
|
91 |
print (f'lvl_4 ::: {lvl_4}')
|
92 |
print (f'lvl_5 ::: {lvl_5}')
|
93 |
+
out=[]
|
94 |
if lvl_1 == "rows":
|
95 |
lvl_src= out_json[lvl_1][0]
|
96 |
else:
|
97 |
lvl_src=out_json[lvl_1]
|
98 |
print (f"lvl_src:: {lvl_src}")
|
99 |
+
try:
|
100 |
if lvl_1 !=[]:
|
101 |
for ea in (lvl_src):
|
102 |
box_1.append(ea)
|
103 |
out= gr.update(choices = [m for m in box_1])
|
104 |
+
except Exception:
|
105 |
+
pass
|
106 |
+
try:
|
107 |
if lvl_2 !=[]:
|
108 |
for ea in (lvl_src[lvl_2]):
|
109 |
print (ea)
|
|
|
111 |
out= gr.update(choices = [m for m in box_2])
|
112 |
else:
|
113 |
pass
|
114 |
+
except Exception:
|
115 |
+
pass
|
116 |
+
try:
|
117 |
if lvl_3 !=[]:
|
118 |
for ea in (lvl_src[lvl_2][lvl_3]):
|
119 |
box_3.append(ea)
|
120 |
out= gr.update(choices = [m for m in box_3])
|
121 |
else:
|
122 |
pass
|
123 |
+
except Exception:
|
124 |
+
pass
|
125 |
+
try:
|
126 |
if lvl_4 !=[]:
|
127 |
for ea in (lvl_src[lvl_2][lvl_3][lvl_4]):
|
128 |
box_4.append(ea)
|
129 |
out= gr.update(choices = [m for m in box_4])
|
130 |
else:
|
131 |
pass
|
|
|
|
|
|
|
132 |
return out
|
133 |
def find_items(lvl_1,lvl_2,lvl_3,lvl_4,lvl_5,fetch_url,config="TEST",split="test",offset=0,length=10):
|
134 |
out_json,_=query2(fetch_url,config,split,offset=10,length=20)
|