Spaces:
Sleeping
Sleeping
File size: 1,316 Bytes
9aa281e ddcae40 9aa281e ddcae40 9aa281e ddcae40 e14ad37 ddcae40 9aa281e ddcae40 9aa281e ddcae40 9aa281e ddcae40 9aa281e ddcae40 9aa281e 18299c6 99dd3f1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
import os
from app.settings import base_path
def initialize_system() -> bool:
success = True
path = os.path.dirname(base_path)
temp_storage_path = os.path.join(path, "app", "temp_storage")
pdfs_path = os.path.join(path, "app", "temp_storage", "pdfs")
database_path = os.path.join(path, "database")
print(f"Base path: {base_path}")
print(f"Parent path: {path}")
print(f"Temp storage path: {temp_storage_path}")
print(f"PDFs path: {pdfs_path}")
print(f"Database path: {database_path}")
try:
os.makedirs(temp_storage_path, exist_ok=True)
print("Created temp_storage_path")
os.makedirs(pdfs_path, exist_ok=True)
print("Created pdfs_path")
os.makedirs(database_path, exist_ok=True)
print("Created database_path")
except Exception as e:
success = False
print(f"Error creating directories: {str(e)}")
try:
# os.system(f"pip install -r {os.path.join(base_path, 'requirements.txt')}")
pass
except Exception as e:
success = False
print(f"Error installing packages: {str(e)}")
return success
if __name__ == '__main__':
print(1111111111111111111111111111111111111111111111)
print(initialize_system())
print(2222222222222222222222222222222222222222222222) |