26 lines
816 B
Python
26 lines
816 B
Python
from enum import Enum
|
|
def load_standard_name(file_path:str):
|
|
try:
|
|
with open(file_path, 'r', encoding='utf-8') as file:
|
|
lines = [line.strip() for line in file if line.strip()]
|
|
return lines
|
|
except FileNotFoundError:
|
|
print(f"错误:文件 {file_path} 不存在")
|
|
raise FileNotFoundError(f"错误:文件 {file_path} 不存在")
|
|
except Exception as e:
|
|
print(f"读取文件时发生错误:{e}")
|
|
raise Exception(f"错误:文件 {file_path} 不存在")
|
|
|
|
|
|
class CheckResult(Enum):
|
|
NO_MATCH = 0 # 不符合检查条件
|
|
MATCH_FOUND = 1 # 匹配到了值
|
|
NEEDS_MORE_ROUNDS = 2 # 需要多轮
|
|
|
|
|
|
class StandardType(Enum):
|
|
#工程名检查
|
|
PROJECT_CHECK = 0
|
|
#项目名检查
|
|
PROGRAM_CHECK = 1
|