|
@@ -40,7 +40,7 @@ from pathlib import Path
|
|
|
from tempfile import NamedTemporaryFile
|
|
|
from typing import Callable
|
|
|
import shutil
|
|
|
-import aiofiles
|
|
|
+
|
|
|
|
|
|
driver = None
|
|
|
|
|
@@ -263,7 +263,7 @@ def save_upload_file_tmp(file: UploadFile) -> Path:
|
|
|
|
|
|
@app.post("/kwtree")
|
|
|
async def kwtree(file: UploadFile = File(...)):
|
|
|
- destination_file_path = "/Users/zooeytsai/Downloads/" + file.filename
|
|
|
+ destination_file_path = "/root/src/kw_tools/web" + file.filename
|
|
|
with codecs.open(destination_file_path,'r','utf-16') as out_file:
|
|
|
# with codecs.open(file.file) as csvfile:
|
|
|
# csv_reader = csv.reader(codecs.iterdecode(file.file, 'utf-8'))
|
|
@@ -334,4 +334,4 @@ async def kwtree(file: UploadFile = File(...)):
|
|
|
|
|
|
# sys.exit()
|
|
|
|
|
|
- return FileResponse(f'/Users/zooeytsai/kw_tools/choozmo/news{news_file}.html',media_type='text/html')
|
|
|
+ return FileResponse(f'/root/kw_tools/web/news{news_file}.html',media_type='text/html')
|