fix: 仪表盘改进
This commit is contained in:
@@ -77,5 +77,5 @@ class SM2Algorithm(BaseAlgorithm):
|
||||
return str(algodata[cls.algo_name]['efactor'])
|
||||
|
||||
@classmethod
|
||||
def nextdate(cls, algodata):
|
||||
def nextdate(cls, algodata) -> int:
|
||||
return algodata[cls.algo_name]['next_date']
|
||||
@@ -50,7 +50,7 @@ class Electron:
|
||||
"评价"
|
||||
return self.algo.rate(self.algodata)
|
||||
|
||||
def nextdate(self):
|
||||
def nextdate(self) -> int:
|
||||
return self.algo.nextdate(self.algodata)
|
||||
|
||||
def revisor(self, quality: int = 5, is_new_activation: bool = False):
|
||||
|
||||
@@ -32,10 +32,19 @@ def load_nucleon(path: pathlib.Path, fmt = "toml"):
|
||||
return lst
|
||||
|
||||
def load_electron(path: pathlib.Path, fmt = "json") -> dict:
|
||||
"""从文件路径加载电子对象
|
||||
|
||||
Args:
|
||||
path (pathlib.Path): 路径
|
||||
fmt (str): 文件格式(可选, 默认 json)
|
||||
|
||||
Returns:
|
||||
dict: 键名是电子对象名称, 值是电子对象
|
||||
"""
|
||||
with open(path, "r") as f:
|
||||
dictdata = dict()
|
||||
dictdata = json.load(f) # type: ignore
|
||||
dic = dict()
|
||||
for item, attr in dictdata.items():
|
||||
dic["item"] = (Electron(hasher.hash(item), attr))
|
||||
dic[item] = (Electron(hasher.hash(item), attr))
|
||||
return dic
|
||||
@@ -14,7 +14,14 @@ def probe_by_filename(filename):
|
||||
return result
|
||||
|
||||
def probe_all(is_stem = 1):
|
||||
"""依据目录探测所有信息"""
|
||||
"""依据目录探测所有信息
|
||||
|
||||
Args:
|
||||
is_stem (boolean): 是否**删除**文件扩展名
|
||||
|
||||
Returns:
|
||||
dict: 有三项, 每一项的键名都是文件组类型, 值都是文件组列表, 只包含文件名
|
||||
"""
|
||||
paths: dict = config_var.get().get("paths")
|
||||
result = {}
|
||||
for item, attr in paths.items():
|
||||
|
||||
Reference in New Issue
Block a user