Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,19 +20,15 @@ def upload_file():
|
|
20 |
# File Delete
|
21 |
@st.dialog("Delete a File")
|
22 |
def delete_file():
|
23 |
-
# List all files in directory and subdirectories
|
24 |
-
|
25 |
for root, dirs, file_names in os.walk(path):
|
26 |
for file_name in file_names:
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
# Delete the file
|
33 |
-
os.remove(os.path.join(path,file_to_delete))
|
34 |
-
st.rerun()
|
35 |
-
|
36 |
# File View
|
37 |
@st.dialog("Files used by AI")
|
38 |
def view_file():
|
|
|
20 |
# File Delete
|
21 |
@st.dialog("Delete a File")
|
22 |
def delete_file():
|
23 |
+
# List all files in directory and subdirectories as buttons
|
24 |
+
|
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_to_delete))
|
30 |
+
st.rerun()
|
31 |
+
|
|
|
|
|
|
|
|
|
32 |
# File View
|
33 |
@st.dialog("Files used by AI")
|
34 |
def view_file():
|