Update app.py
Browse files
app.py
CHANGED
|
@@ -38,7 +38,7 @@ def is_valid_file(file_path: str, file_types: list[str]) -> bool:
|
|
| 38 |
|
| 39 |
# Gradio Interface
|
| 40 |
with gr.Blocks(css=".gr-box {border-radius: 8px;}") as demo:
|
| 41 |
-
# App-Titel
|
| 42 |
gr.Markdown(
|
| 43 |
"""
|
| 44 |
## 📝 Checker
|
|
@@ -56,7 +56,19 @@ with gr.Blocks(css=".gr-box {border-radius: 8px;}") as demo:
|
|
| 56 |
output_text = gr.Textbox(label="Dateiinhalt", lines=10)
|
| 57 |
|
| 58 |
# Callback zum Verarbeiten der Datei
|
| 59 |
-
file_input.change(process_file, inputs=file_input, outputs=output_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
# App starten
|
| 62 |
demo.launch()
|
|
|
|
| 38 |
|
| 39 |
# Gradio Interface
|
| 40 |
with gr.Blocks(css=".gr-box {border-radius: 8px;}") as demo:
|
| 41 |
+
''''# App-Titel
|
| 42 |
gr.Markdown(
|
| 43 |
"""
|
| 44 |
## 📝 Checker
|
|
|
|
| 56 |
output_text = gr.Textbox(label="Dateiinhalt", lines=10)
|
| 57 |
|
| 58 |
# Callback zum Verarbeiten der Datei
|
| 59 |
+
file_input.change(process_file, inputs=file_input, outputs=output_text)'''
|
| 60 |
+
file = brm_file(appKey='brm-file', visible=False)
|
| 61 |
+
visible_btn = gr.Button('Visible')
|
| 62 |
+
def update():
|
| 63 |
+
return brm_file(appKey='brm-file', visible=True)
|
| 64 |
+
visible_btn.click(update, outputs=file)
|
| 65 |
+
def close():
|
| 66 |
+
print('close')
|
| 67 |
+
return brm_file(appKey='brm-file', visible=False)
|
| 68 |
+
def changed(e):
|
| 69 |
+
print(e)
|
| 70 |
+
return close()
|
| 71 |
+
file.change(changed, inputs=file, outputs=file)
|
| 72 |
|
| 73 |
# App starten
|
| 74 |
demo.launch()
|