Diego Marroquin commited on
Commit
f5cd3c0
·
1 Parent(s): e603670

Debugging

Browse files
Files changed (1) hide show
  1. app.py +14 -32
app.py CHANGED
@@ -601,39 +601,21 @@ def run_app():
601
  current_minute = current_datetime.strftime('%M')
602
  current_second = current_datetime.strftime('%S')
603
 
604
- with st.form("unfiltered_excel_form"):
605
- unfiltered_submitted = st.form_submit_button("Get Unfiltered Excel")
606
-
607
- with st.form("filtered_excel_form"):
608
- filtered_submitted = st.form_submit_button("Get Filtered Excel")
609
-
610
- if unfiltered_submitted:
611
- # Save the DataFrame to the BytesIO object as an Excel file
612
- df.to_excel(excel_buffer, index=True)
613
- # Set the cursor position to the beginning of the BytesIO object
614
- excel_buffer.seek(0)
615
-
616
- # Provide the BytesIO object to the download button
617
- download_button = st.download_button(
618
- label="Download Excel",
619
- data=excel_buffer,
620
- file_name=f"nucmonitor_data_{current_year}-{current_month}-{current_day}-h{current_hour}m{current_minute}s{current_second}.xlsx",
621
- mime="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
622
- )
623
 
624
- elif filtered_submitted:
625
- # Save the DataFrame to the BytesIO object as an Excel file
626
- filtered_by_plant.to_excel(excel_buffer, index=True)
627
- # Set the cursor position to the beginning of the BytesIO object
628
- excel_buffer.seek(0)
629
-
630
- # Provide the BytesIO object to the download button
631
- download_button = st.download_button(
632
- label="Download Excel",
633
- data=excel_buffer,
634
- file_name=f"nucmonitor_data_{current_year}-{current_month}-{current_day}-h{current_hour}m{current_minute}s{current_second}.xlsx",
635
- mime="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
636
- )
 
637
 
638
 
639
  if __name__ == '__main__':
 
601
  current_minute = current_datetime.strftime('%M')
602
  current_second = current_datetime.strftime('%S')
603
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
604
 
605
+ # Save the DataFrame to the BytesIO object as an Excel file
606
+ df.to_excel(excel_buffer, index=True)
607
+ # Set the cursor position to the beginning of the BytesIO object
608
+ excel_buffer.seek(0)
609
+
610
+ # Provide the BytesIO object to the download button
611
+ download_button = st.download_button(
612
+ label="Download Excel",
613
+ data=excel_buffer,
614
+ file_name=f"nucmonitor_data_{current_year}-{current_month}-{current_day}-h{current_hour}m{current_minute}s{current_second}.xlsx",
615
+ mime="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
616
+ )
617
+
618
+
619
 
620
 
621
  if __name__ == '__main__':