Commit 391402b1 authored by zhougaofeng's avatar zhougaofeng
Browse files

Update common_parse.py

parent 13af2481
...@@ -43,7 +43,7 @@ def process_file(file_path, output_dir): ...@@ -43,7 +43,7 @@ def process_file(file_path, output_dir):
start = time.time() start = time.time()
if file_path.endswith('.pdf'): if file_path.endswith('.pdf'):
res = pdf_ocr.ocr_pdf_client(path=file_path, output_dir=output_dir) res = pdf_ocr.ocr_pdf_client(config_path,file_path,output_dir)
elif file_path.endswith('.xls') or file_path.endswith('.xlsx'): elif file_path.endswith('.xls') or file_path.endswith('.xlsx'):
res = excel_ocr.parse(file_path, output_dir) res = excel_ocr.parse(file_path, output_dir)
elif file_path.endswith('.ofd'): elif file_path.endswith('.ofd'):
...@@ -58,7 +58,7 @@ def process_file(file_path, output_dir): ...@@ -58,7 +58,7 @@ def process_file(file_path, output_dir):
except requests.exceptions.RequestException as req_err: except requests.exceptions.RequestException as req_err:
logger.error(f"请求错误,文件: '{file_path}',错误信息: {req_err}") logger.error(f"请求错误,文件: '{file_path}',错误信息: {req_err}")
except Exception as err: except Exception as err:
logger.error(f"处理文件时发生未知错误: '{file_path}',错误信息: {err},res:{res}") logger.error(f"处理文件时发生未知错误: '{file_path}',错误信息: {err}")
def normalize_path(input_path): def normalize_path(input_path):
"""Normalize file paths to use forward slashes.""" """Normalize file paths to use forward slashes."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment