Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,7 +23,6 @@ def upload_file():
|
|
| 23 |
@st.dialog("Delete a File")
|
| 24 |
def delete_file():
|
| 25 |
# List all files in directory and subdirectories as buttons
|
| 26 |
-
|
| 27 |
for root, dirs, file_names in os.walk(path):
|
| 28 |
for file_name in file_names:
|
| 29 |
if st.button(file_name):
|
|
@@ -39,27 +38,18 @@ def view_file():
|
|
| 39 |
for root, dirs, file_names in os.walk(path):
|
| 40 |
for file_name in file_names:
|
| 41 |
files.append(file_name)
|
| 42 |
-
|
| 43 |
st.write(files)
|
| 44 |
if st.button("Close"):
|
| 45 |
st.rerun()
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
|
| 51 |
|
| 52 |
logo_column, space_column, upload_column, delete_column, browse_column, recycle_column = st.columns(6)
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
st.markdown(
|
| 57 |
'<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"/> ',
|
| 58 |
unsafe_allow_html=True,
|
| 59 |
)
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
| 63 |
with logo_column:
|
| 64 |
image = Image.open(os.path.join(path,'spaces-hot-dog-streamlit.png'))
|
| 65 |
st.image(image, caption='CRIStine')
|
|
@@ -81,8 +71,6 @@ with upload_column:
|
|
| 81 |
if st.button("Upload", key='upload'):
|
| 82 |
upload_file()
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
| 86 |
with delete_column:
|
| 87 |
with stylable_container(
|
| 88 |
key="delete_button",
|
|
@@ -99,8 +87,7 @@ with delete_column:
|
|
| 99 |
):
|
| 100 |
if st.button("Delete", key='delete'):
|
| 101 |
delete_file()
|
| 102 |
-
|
| 103 |
-
|
| 104 |
with browse_column:
|
| 105 |
with stylable_container(
|
| 106 |
key="view_button",
|
|
@@ -117,8 +104,7 @@ with browse_column:
|
|
| 117 |
):
|
| 118 |
if st.button("View", key='view'):
|
| 119 |
view_file()
|
| 120 |
-
|
| 121 |
-
|
| 122 |
with recycle_column:
|
| 123 |
with stylable_container(
|
| 124 |
key="recycle_button",
|
|
@@ -134,12 +120,6 @@ with recycle_column:
|
|
| 134 |
""",
|
| 135 |
):
|
| 136 |
st.button("Recycle", key='recycle')
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
|
| 144 |
# Main app goes below here -
|
| 145 |
|
|
|
|
| 23 |
@st.dialog("Delete a File")
|
| 24 |
def delete_file():
|
| 25 |
# List all files in directory and subdirectories as buttons
|
|
|
|
| 26 |
for root, dirs, file_names in os.walk(path):
|
| 27 |
for file_name in file_names:
|
| 28 |
if st.button(file_name):
|
|
|
|
| 38 |
for root, dirs, file_names in os.walk(path):
|
| 39 |
for file_name in file_names:
|
| 40 |
files.append(file_name)
|
|
|
|
| 41 |
st.write(files)
|
| 42 |
if st.button("Close"):
|
| 43 |
st.rerun()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
|
| 46 |
logo_column, space_column, upload_column, delete_column, browse_column, recycle_column = st.columns(6)
|
| 47 |
|
|
|
|
|
|
|
| 48 |
st.markdown(
|
| 49 |
'<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"/> ',
|
| 50 |
unsafe_allow_html=True,
|
| 51 |
)
|
| 52 |
|
|
|
|
|
|
|
| 53 |
with logo_column:
|
| 54 |
image = Image.open(os.path.join(path,'spaces-hot-dog-streamlit.png'))
|
| 55 |
st.image(image, caption='CRIStine')
|
|
|
|
| 71 |
if st.button("Upload", key='upload'):
|
| 72 |
upload_file()
|
| 73 |
|
|
|
|
|
|
|
| 74 |
with delete_column:
|
| 75 |
with stylable_container(
|
| 76 |
key="delete_button",
|
|
|
|
| 87 |
):
|
| 88 |
if st.button("Delete", key='delete'):
|
| 89 |
delete_file()
|
| 90 |
+
|
|
|
|
| 91 |
with browse_column:
|
| 92 |
with stylable_container(
|
| 93 |
key="view_button",
|
|
|
|
| 104 |
):
|
| 105 |
if st.button("View", key='view'):
|
| 106 |
view_file()
|
| 107 |
+
|
|
|
|
| 108 |
with recycle_column:
|
| 109 |
with stylable_container(
|
| 110 |
key="recycle_button",
|
|
|
|
| 120 |
""",
|
| 121 |
):
|
| 122 |
st.button("Recycle", key='recycle')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
# Main app goes below here -
|
| 125 |
|