Spaces:
Sleeping
Sleeping
wip
Browse files
sabiduria_tool_api/api/routes/router_sabiduria_tool.py
CHANGED
@@ -5,9 +5,10 @@ from fastapi.responses import FileResponse
|
|
5 |
from sabiduria_tool_api.services.service_sabiduria_tool import FileProcess
|
6 |
|
7 |
from pathlib import Path
|
|
|
8 |
|
9 |
router_file = APIRouter()
|
10 |
-
ROOT_DIR = str(Path(__file__).parent.parent.parent.parent)
|
11 |
|
12 |
@router_file.post("/file", name="concatane files")
|
13 |
async def upload_files(
|
|
|
5 |
from sabiduria_tool_api.services.service_sabiduria_tool import FileProcess
|
6 |
|
7 |
from pathlib import Path
|
8 |
+
from os import getcwd
|
9 |
|
10 |
router_file = APIRouter()
|
11 |
+
ROOT_DIR = getcwd() #str(Path(__file__).parent.parent.parent.parent)
|
12 |
|
13 |
@router_file.post("/file", name="concatane files")
|
14 |
async def upload_files(
|
sabiduria_tool_api/data/init.txt
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
testing
|
|
|
|
sabiduria_tool_api/services/service_sabiduria_tool.py
CHANGED
@@ -32,11 +32,6 @@ class FileProcess:
|
|
32 |
for o_file in old_files:
|
33 |
remove(f"{self.data_store_path}{o_file}")
|
34 |
else:
|
35 |
-
system("ls")
|
36 |
-
print("#"*30)
|
37 |
-
system("pwd")
|
38 |
-
print("#"*30)
|
39 |
-
system(self.data_store_path)
|
40 |
mkdir(self.data_store_path)
|
41 |
for file in self.files:
|
42 |
with open(f"{self.data_store_path}{file.filename}", "wb") as destination:
|
|
|
32 |
for o_file in old_files:
|
33 |
remove(f"{self.data_store_path}{o_file}")
|
34 |
else:
|
|
|
|
|
|
|
|
|
|
|
35 |
mkdir(self.data_store_path)
|
36 |
for file in self.files:
|
37 |
with open(f"{self.data_store_path}{file.filename}", "wb") as destination:
|