Fix typo (#3319)
Browse files### What problem does this PR solve?
Fix typo
### Type of change
- [x] Refactoring
- api/apps/document_app.py +1 -1
- api/{contants.py → constants.py} +0 -0
- api/utils/file_utils.py +3 -3
api/apps/document_app.py
CHANGED
|
@@ -39,7 +39,7 @@ from api.utils.api_utils import get_json_result
|
|
| 39 |
from rag.utils.storage_factory import STORAGE_IMPL
|
| 40 |
from api.utils.file_utils import filename_type, thumbnail
|
| 41 |
from api.utils.web_utils import html2pdf, is_valid_url
|
| 42 |
-
from api.
|
| 43 |
|
| 44 |
|
| 45 |
@manager.route('/upload', methods=['POST'])
|
|
|
|
| 39 |
from rag.utils.storage_factory import STORAGE_IMPL
|
| 40 |
from api.utils.file_utils import filename_type, thumbnail
|
| 41 |
from api.utils.web_utils import html2pdf, is_valid_url
|
| 42 |
+
from api.constants import IMG_BASE64_PREFIX
|
| 43 |
|
| 44 |
|
| 45 |
@manager.route('/upload', methods=['POST'])
|
api/{contants.py → constants.py}
RENAMED
|
File without changes
|
api/utils/file_utils.py
CHANGED
|
@@ -25,7 +25,7 @@ from cachetools import LRUCache, cached
|
|
| 25 |
from ruamel.yaml import YAML
|
| 26 |
|
| 27 |
from api.db import FileType
|
| 28 |
-
from api.
|
| 29 |
|
| 30 |
PROJECT_BASE = os.getenv("RAG_PROJECT_BASE") or os.getenv("RAG_DEPLOY_BASE")
|
| 31 |
RAG_BASE = os.getenv("RAG_BASE")
|
|
@@ -71,7 +71,7 @@ def get_home_cache_dir():
|
|
| 71 |
dir = os.path.join(os.path.expanduser('~'), ".ragflow")
|
| 72 |
try:
|
| 73 |
os.mkdir(dir)
|
| 74 |
-
except OSError
|
| 75 |
pass
|
| 76 |
return dir
|
| 77 |
|
|
@@ -193,7 +193,7 @@ def thumbnail_img(filename, blob):
|
|
| 193 |
presentation.slides[0].get_thumbnail(0.03, 0.03).save(
|
| 194 |
buffered, drawing.imaging.ImageFormat.png)
|
| 195 |
return buffered.getvalue()
|
| 196 |
-
except Exception
|
| 197 |
pass
|
| 198 |
return None
|
| 199 |
|
|
|
|
| 25 |
from ruamel.yaml import YAML
|
| 26 |
|
| 27 |
from api.db import FileType
|
| 28 |
+
from api.constants import IMG_BASE64_PREFIX
|
| 29 |
|
| 30 |
PROJECT_BASE = os.getenv("RAG_PROJECT_BASE") or os.getenv("RAG_DEPLOY_BASE")
|
| 31 |
RAG_BASE = os.getenv("RAG_BASE")
|
|
|
|
| 71 |
dir = os.path.join(os.path.expanduser('~'), ".ragflow")
|
| 72 |
try:
|
| 73 |
os.mkdir(dir)
|
| 74 |
+
except OSError:
|
| 75 |
pass
|
| 76 |
return dir
|
| 77 |
|
|
|
|
| 193 |
presentation.slides[0].get_thumbnail(0.03, 0.03).save(
|
| 194 |
buffered, drawing.imaging.ImageFormat.png)
|
| 195 |
return buffered.getvalue()
|
| 196 |
+
except Exception:
|
| 197 |
pass
|
| 198 |
return None
|
| 199 |
|