使用 ProgressInfoBar 替代原有方案
This commit is contained in:
@@ -215,10 +215,10 @@ class ExcelReader:
|
||||
|
||||
except Exception as e:
|
||||
error_message = traceback.format_exc()
|
||||
raise f"""
|
||||
raise Exception(f"""
|
||||
原始错误:
|
||||
{error_message}
|
||||
"""
|
||||
""")
|
||||
|
||||
def set_file_path(self, file_path: str):
|
||||
self.file_path = file_path
|
||||
|
||||
@@ -71,6 +71,7 @@ class DTGWorker(QObject):
|
||||
class ARGWorker(QObject):
|
||||
finished = Signal()
|
||||
error = Signal(str, str)
|
||||
info = Signal(str, str)
|
||||
|
||||
def __init__(self, input_filepath: str, output_filepath: str, output_filename: str, disable_cc: bool = False):
|
||||
super().__init__()
|
||||
@@ -81,10 +82,10 @@ class ARGWorker(QObject):
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
excel = ExcelReader(self.input_filepath, self.disable_compatibility_check)
|
||||
excel = ExcelReader(self.input_filepath, self.disable_compatibility_check, self.info.emit)
|
||||
excel.run()
|
||||
|
||||
doc = DocxWriter(self.output_filepath, self.output_filename, excel)
|
||||
doc = DocxWriter(self.output_filepath, self.output_filename, excel, self.info.emit)
|
||||
doc.write()
|
||||
except Exception as e:
|
||||
self.error.emit("😢 不好出错了", str(e))
|
||||
|
||||
Reference in New Issue
Block a user