在导入数据时,将校验数据的扩展名是否合法
This commit is contained in:
@ -177,7 +177,7 @@ class PublicFunc:
|
||||
QApplication.processEvents()
|
||||
|
||||
@staticmethod
|
||||
def examine_file(path_str, filename):
|
||||
def examine_file(path_str, filename, suffix):
|
||||
temp_path = list(
|
||||
Path(path_str).glob(f"{filename}*"))
|
||||
if len(temp_path) == 0:
|
||||
@ -201,6 +201,11 @@ class PublicFunc:
|
||||
info=Constants.INPUT_FAILURE + "\n" +
|
||||
filename + ":" +
|
||||
Constants.FAILURE_REASON["Data_Frequency_Not_In_Filename"])
|
||||
if Path(path).suffix != suffix:
|
||||
return Result().failure(
|
||||
info=Constants.INPUT_FAILURE + "\n" +
|
||||
filename + ":" +
|
||||
Constants.FAILURE_REASON["Suffix_Not_Correct"])
|
||||
data = {
|
||||
"path": str(path),
|
||||
"freq": int(freq)
|
||||
|
||||
Reference in New Issue
Block a user