From 2a07a50a602686e9fddabcfe1a7f108944470f94 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Thu, 28 Nov 2024 16:17:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=8F=90=E5=8F=96doc=E5=9B=BE=E7=89=87=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=92=8C=E5=B1=95=E7=A4=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/handle/base_parse_table_handle.py | 2 +- apps/common/handle/impl/table/csv_parse_table_handle.py | 2 +- apps/common/handle/impl/table/xls_parse_table_handle.py | 2 +- apps/common/handle/impl/table/xlsx_parse_table_handle.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/common/handle/base_parse_table_handle.py b/apps/common/handle/base_parse_table_handle.py index b84690859..65eaf897f 100644 --- a/apps/common/handle/base_parse_table_handle.py +++ b/apps/common/handle/base_parse_table_handle.py @@ -19,5 +19,5 @@ class BaseParseTableHandle(ABC): pass @abstractmethod - def get_content(self, file): + def get_content(self, file, save_image): pass \ No newline at end of file diff --git a/apps/common/handle/impl/table/csv_parse_table_handle.py b/apps/common/handle/impl/table/csv_parse_table_handle.py index dcd971839..e2fc7ce86 100644 --- a/apps/common/handle/impl/table/csv_parse_table_handle.py +++ b/apps/common/handle/impl/table/csv_parse_table_handle.py @@ -35,7 +35,7 @@ class CsvSplitHandle(BaseParseTableHandle): return [{'name': file.name, 'paragraphs': paragraphs}] - def get_content(self, file): + def get_content(self, file, save_image): buffer = file.read() try: return buffer.decode(detect(buffer)['encoding']) diff --git a/apps/common/handle/impl/table/xls_parse_table_handle.py b/apps/common/handle/impl/table/xls_parse_table_handle.py index 0fee4e35b..5b7f594a1 100644 --- a/apps/common/handle/impl/table/xls_parse_table_handle.py +++ b/apps/common/handle/impl/table/xls_parse_table_handle.py @@ -61,7 +61,7 @@ class XlsSplitHandle(BaseParseTableHandle): return [{'name': file.name, 'paragraphs': []}] return result - def get_content(self, file): + def get_content(self, file, save_image): # 打开 .xls 文件 try: workbook = xlrd.open_workbook(file_contents=file.read(), formatting_info=True) diff --git a/apps/common/handle/impl/table/xlsx_parse_table_handle.py b/apps/common/handle/impl/table/xlsx_parse_table_handle.py index 3fd40b2d1..2ae22d019 100644 --- a/apps/common/handle/impl/table/xlsx_parse_table_handle.py +++ b/apps/common/handle/impl/table/xlsx_parse_table_handle.py @@ -74,7 +74,7 @@ class XlsxSplitHandle(BaseParseTableHandle): return result - def get_content(self, file): + def get_content(self, file, save_image): try: # 加载 Excel 文件 workbook = load_workbook(file)