w3robotics commited on
Commit
0441490
·
verified ·
1 Parent(s): e92459e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -25,9 +25,14 @@ def delete_file():
25
  for root, dirs, file_names in os.walk(path):
26
  for file_name in file_names:
27
  if st.button(file_name):
28
- # Delete the file
29
- os.remove(os.path.join(path,file_name))
30
- st.rerun()
 
 
 
 
 
31
 
32
  # File View
33
  @st.dialog("Files used by AI")
@@ -43,9 +48,7 @@ def view_file():
43
  st.rerun()
44
 
45
 
46
-
47
-
48
-
49
 
50
 
51
 
 
25
  for root, dirs, file_names in os.walk(path):
26
  for file_name in file_names:
27
  if st.button(file_name):
28
+ # Confirm User Wants to do this
29
+ file_details = {"Confirm deletion of ":file_name}
30
+ st.write(file_details)
31
+ if st.button("Yes"):
32
+ os.remove(os.path.join(path,file_name))
33
+ st.rerun()
34
+ if st.button("No"):
35
+ st.rerun()
36
 
37
  # File View
38
  @st.dialog("Files used by AI")
 
48
  st.rerun()
49
 
50
 
51
+
 
 
52
 
53
 
54