|
@@ -4,6 +4,7 @@ import os
|
|
import random
|
|
import random
|
|
import sys
|
|
import sys
|
|
import time
|
|
import time
|
|
|
|
+from glob import glob
|
|
from multiprocessing import Process
|
|
from multiprocessing import Process
|
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
|
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
|
|
from format_convert.utils import get_platform, request_post, get_md5_from_bytes
|
|
from format_convert.utils import get_platform, request_post, get_md5_from_bytes
|
|
@@ -21,9 +22,9 @@ def test_one(p, from_remote=False):
|
|
data = {"file": file_base64, "type": p.split(".")[-1], "filemd5": 100}
|
|
data = {"file": file_base64, "type": p.split(".")[-1], "filemd5": 100}
|
|
if from_remote:
|
|
if from_remote:
|
|
# _url = 'http://121.46.18.113:15010/convert'
|
|
# _url = 'http://121.46.18.113:15010/convert'
|
|
- _url = 'http://192.168.2.103:15010/convert'
|
|
|
|
|
|
+ # _url = 'http://192.168.2.103:15010/convert'
|
|
# _url = 'http://172.16.160.65:15010/convert'
|
|
# _url = 'http://172.16.160.65:15010/convert'
|
|
- # _url = 'http://127.0.0.1:15010/convert'
|
|
|
|
|
|
+ _url = 'http://127.0.0.1:15010/convert'
|
|
result = json.loads(request_post(_url, data, time_out=10000))
|
|
result = json.loads(request_post(_url, data, time_out=10000))
|
|
text_str = ""
|
|
text_str = ""
|
|
for t in result.get("result_html"):
|
|
for t in result.get("result_html"):
|
|
@@ -57,12 +58,17 @@ if __name__ == '__main__':
|
|
# file_path = "C:/Users/Administrator/Desktop/test_xls/merge_cell.xlsx"
|
|
# file_path = "C:/Users/Administrator/Desktop/test_xls/merge_cell.xlsx"
|
|
# file_path = "D:/BIDI_DOC/比地_文档/2022/Test_Interface/20210609202634853485.xlsx"
|
|
# file_path = "D:/BIDI_DOC/比地_文档/2022/Test_Interface/20210609202634853485.xlsx"
|
|
# file_path = "D:/BIDI_DOC/比地_文档/2022/Test_ODPS/1624325845476.pdf"
|
|
# file_path = "D:/BIDI_DOC/比地_文档/2022/Test_ODPS/1624325845476.pdf"
|
|
- # file_path = "C:/Users/Administrator/Downloads/1647913696016.jpg"
|
|
|
|
- file_path = "C:/Users/Administrator/Desktop/test_image/error7.jpg"
|
|
|
|
|
|
+ # file_path = "C:/Users/Administrator/Downloads/神仙居旅游汽车租赁竞争性磋商文件(1).doc"
|
|
|
|
+ # file_path = "C:/Users/Administrator/Desktop/test_xls/error2.xlsx"
|
|
|
|
+ file_path = "C:/Users/Administrator/Desktop/test_doc/error5.docx"
|
|
else:
|
|
else:
|
|
file_path = "1660296734009.pdf"
|
|
file_path = "1660296734009.pdf"
|
|
test_one(file_path, from_remote=True)
|
|
test_one(file_path, from_remote=True)
|
|
|
|
|
|
|
|
+ # paths = glob("C:/Users/Administrator/Desktop/test_image/*")
|
|
|
|
+ # for file_path in paths:
|
|
|
|
+ # test_one(file_path, from_remote=True)
|
|
|
|
+
|
|
# if get_platform() == "Windows":
|
|
# if get_platform() == "Windows":
|
|
# # file_path_list = ["D:/BIDI_DOC/比地_文档/2022/Test_Interface/1623328459080.doc",
|
|
# # file_path_list = ["D:/BIDI_DOC/比地_文档/2022/Test_Interface/1623328459080.doc",
|
|
# # "D:/BIDI_DOC/比地_文档/2022/Test_Interface/94961e1987d1090e.xls",
|
|
# # "D:/BIDI_DOC/比地_文档/2022/Test_Interface/94961e1987d1090e.xls",
|