awacke1 commited on
Commit
ac2bde0
·
1 Parent(s): 60cbe23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -492,16 +492,18 @@ def main():
492
  all_files = [file for file in all_files if len(os.path.splitext(file)[0]) >= 20] # exclude files with short names
493
  all_files.sort(key=lambda x: (os.path.splitext(x)[1], x), reverse=True) # sort by file type and file name in descending order
494
 
495
- # Added "Delete All" button
496
- if st.sidebar.button("🗑 Delete All"):
497
- for file in all_files:
498
- os.remove(file)
499
- st.experimental_rerun()
500
-
501
- # Added "Download All" button
502
- if st.sidebar.button("⬇️ Download All"):
503
- zip_file = create_zip_of_files(all_files)
504
- st.sidebar.markdown(get_zip_download_link(zip_file), unsafe_allow_html=True)
 
 
505
 
506
  # Sidebar of Files Saving History and surfacing files as context of prompts and responses
507
  file_contents=''
 
492
  all_files = [file for file in all_files if len(os.path.splitext(file)[0]) >= 20] # exclude files with short names
493
  all_files.sort(key=lambda x: (os.path.splitext(x)[1], x), reverse=True) # sort by file type and file name in descending order
494
 
495
+
496
+ # Sidebar buttons Download All and Delte All
497
+ colDownloadAll, colDeleteAll = st.sidebar.columns([3,3])
498
+ with colDownloadAll:
499
+ if st.sidebar.button("⬇️ Download All"):
500
+ zip_file = create_zip_of_files(all_files)
501
+ st.sidebar.markdown(get_zip_download_link(zip_file), unsafe_allow_html=True)
502
+ with colDeleteAll:
503
+ if st.sidebar.button("🗑 Delete All"):
504
+ for file in all_files:
505
+ os.remove(file)
506
+ st.experimental_rerun()
507
 
508
  # Sidebar of Files Saving History and surfacing files as context of prompts and responses
509
  file_contents=''