Spaces:
Runtime error
Runtime error
arkamaldeen
commited on
Commit
•
5403de0
1
Parent(s):
5c92236
Updated the save button
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ def load_css(file_path):
|
|
32 |
|
33 |
|
34 |
# Load CSS file
|
35 |
-
|
36 |
|
37 |
|
38 |
# ----- FUNCTIONS ----
|
@@ -318,26 +318,23 @@ def main():
|
|
318 |
|
319 |
with col1:
|
320 |
saved_button = False
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
with open(file_path, "w", encoding="utf-8") as file:
|
339 |
-
file.write(data)
|
340 |
-
saved_button = True
|
341 |
|
342 |
with col2:
|
343 |
if st.button("Clear"):
|
|
|
32 |
|
33 |
|
34 |
# Load CSS file
|
35 |
+
load_css('styles2.css')
|
36 |
|
37 |
|
38 |
# ----- FUNCTIONS ----
|
|
|
318 |
|
319 |
with col1:
|
320 |
saved_button = False
|
321 |
+
|
322 |
+
if is_a_sitemap:
|
323 |
+
saved_data = st.session_state.sitemap_data
|
324 |
+
|
325 |
+
if st.download_button(
|
326 |
+
label="Save",
|
327 |
+
data=saved_data
|
328 |
+
):
|
329 |
+
saved_button = True
|
330 |
+
|
331 |
+
|
332 |
+
else:
|
333 |
+
if st.download_button(
|
334 |
+
label="Save",
|
335 |
+
data=data
|
336 |
+
):
|
337 |
+
saved_button = True
|
|
|
|
|
|
|
338 |
|
339 |
with col2:
|
340 |
if st.button("Clear"):
|