Spaces:
Runtime error
Runtime error
Commit
·
074fb63
1
Parent(s):
dbb1743
clear forms
Browse files
app.py
CHANGED
|
@@ -30,12 +30,15 @@ def get_parsed_address(input_img):
|
|
| 30 |
def save_deta_db(input):
|
| 31 |
eval_result = ast.literal_eval(input)
|
| 32 |
utils.write_db(eval_result)
|
| 33 |
-
return
|
|
|
|
| 34 |
|
| 35 |
def update_component():
|
| 36 |
-
return gr.update(value=
|
| 37 |
|
| 38 |
|
|
|
|
|
|
|
| 39 |
|
| 40 |
|
| 41 |
# Open API on change
|
|
@@ -149,8 +152,11 @@ with gr.Blocks() as demo:
|
|
| 149 |
|
| 150 |
submit_button = gr.Button(value="Veriyi Birimlere Yolla")
|
| 151 |
# submit_button.click(save_deta_db, open_api_text)
|
| 152 |
-
done_text = gr.Textbox(label=
|
| 153 |
submit_button.click(update_component, outputs=done_text)
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
if __name__ == "__main__":
|
| 156 |
demo.launch()
|
|
|
|
| 30 |
def save_deta_db(input):
|
| 31 |
eval_result = ast.literal_eval(input)
|
| 32 |
utils.write_db(eval_result)
|
| 33 |
+
return
|
| 34 |
+
|
| 35 |
|
| 36 |
def update_component():
|
| 37 |
+
return gr.update(value="Gonderildi, tesekkurler.", visible=True)
|
| 38 |
|
| 39 |
|
| 40 |
+
def clear_textbox(value):
|
| 41 |
+
return gr.update(value="")
|
| 42 |
|
| 43 |
|
| 44 |
# Open API on change
|
|
|
|
| 152 |
|
| 153 |
submit_button = gr.Button(value="Veriyi Birimlere Yolla")
|
| 154 |
# submit_button.click(save_deta_db, open_api_text)
|
| 155 |
+
done_text = gr.Textbox(label="Done", value="Not Done", visible=False)
|
| 156 |
submit_button.click(update_component, outputs=done_text)
|
| 157 |
+
for txt in [city, distinct, neighbourhood, street, address, tel, name_surname, no]:
|
| 158 |
+
submit_button.click(fn=clear_textbox, inputs=txt, outputs=txt)
|
| 159 |
+
|
| 160 |
|
| 161 |
if __name__ == "__main__":
|
| 162 |
demo.launch()
|