Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -144,4 +144,22 @@ def process_inputs(html_file, tarefa_files):
|
|
144 |
return df.to_html(index=False), html_output_path
|
145 |
|
146 |
def download_html_file(file_path):
|
147 |
-
return file_path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
return df.to_html(index=False), html_output_path
|
145 |
|
146 |
def download_html_file(file_path):
|
147 |
+
return file_path
|
148 |
+
|
149 |
+
# --- Interface Gradio ---
|
150 |
+
|
151 |
+
with gr.Blocks() as interface:
|
152 |
+
gr.Markdown("# Processamento de Relat贸rios de Tarefas")
|
153 |
+
html_file = gr.File(label="Upload HTML File (alunos.htm)", type="binary")
|
154 |
+
excel_files = gr.Files(label="Upload Excel Files (Relat贸rios de Tarefas)", type="binary", file_count="multiple")
|
155 |
+
generate_btn = gr.Button("Generate Report")
|
156 |
+
output_html = gr.HTML()
|
157 |
+
download_btn = gr.File(label="Download Report")
|
158 |
+
|
159 |
+
def process_and_prepare_download(html_file, tarefa_files):
|
160 |
+
html_content, file_path = process_inputs(html_file, tarefa_files)
|
161 |
+
return html_content, file_path
|
162 |
+
|
163 |
+
generate_btn.click(fn=process_and_prepare_download, inputs=[html_file, excel_files], outputs=[output_html, download_btn])
|
164 |
+
|
165 |
+
interface.launch()
|