Spaces:
Sleeping
Sleeping
Clear code pruned down
Browse files
app.py
CHANGED
@@ -435,36 +435,6 @@ with strategies_container:
|
|
435 |
else:
|
436 |
pass
|
437 |
# st.warning("No 'data' subfolder found.")
|
438 |
-
|
439 |
-
if os.path.exists("ESG_Documents_Portfolio"):
|
440 |
-
# Iterate through files in the subfolder and delete them
|
441 |
-
for filename in os.listdir("ESG_Documents_Portfolio"):
|
442 |
-
file_path = os.path.join("ESG_Documents_Portfolio", filename)
|
443 |
-
try:
|
444 |
-
if os.path.isfile(file_path):
|
445 |
-
os.unlink(file_path)
|
446 |
-
except Exception as e:
|
447 |
-
st.error(f"Error deleting {file_path}: {e}")
|
448 |
-
else:
|
449 |
-
pass
|
450 |
-
# st.warning("No 'data' subfolder found.")
|
451 |
-
|
452 |
-
folders_to_clean = ["data", "chroma_db_portfolio", "chroma_db_LT", "chroma_db_fin"]
|
453 |
-
|
454 |
-
for folder_path in folders_to_clean:
|
455 |
-
if os.path.exists(folder_path):
|
456 |
-
for item in os.listdir(folder_path):
|
457 |
-
item_path = os.path.join(folder_path, item)
|
458 |
-
try:
|
459 |
-
if os.path.isfile(item_path) or os.path.islink(item_path):
|
460 |
-
os.unlink(item_path) # Remove files or symbolic links
|
461 |
-
elif os.path.isdir(item_path):
|
462 |
-
shutil.rmtree(item_path) # Remove subfolders and all their contents
|
463 |
-
except Exception as e:
|
464 |
-
st.error(f"Error deleting {item_path}: {e}")
|
465 |
-
else:
|
466 |
-
pass
|
467 |
-
# st.warning(f"No '{folder_path}' folder found.")
|
468 |
|
469 |
with mrow1_col1:
|
470 |
st.subheader("Summary of the ESG Analysis")
|
|
|
435 |
else:
|
436 |
pass
|
437 |
# st.warning("No 'data' subfolder found.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
438 |
|
439 |
with mrow1_col1:
|
440 |
st.subheader("Summary of the ESG Analysis")
|