Compare commits

...

3 Commits

Author SHA1 Message Date
efd826f677 一些兼容问题 2025-12-20 19:47:50 +08:00
ad17b905c4 修复ToolFile中SaveAsJson的一些问题 2025-11-23 20:03:44 +08:00
4ba5bfdfee 新增函数泛型注解 2025-11-06 20:37:30 +08:00
4 changed files with 5 additions and 5 deletions

View File

@@ -140,7 +140,7 @@ class Architecture:
return type_ in cls._RegisteredObjects
@classmethod
def Get(cls, type_:type) -> Any:
def Get[T](cls, type_:Typen[T]) -> T:
return cls._RegisteredObjects[type_]
@classmethod

View File

@@ -187,10 +187,10 @@ def InternalImportingThrow(
):
with lock_guard():
requierds_str = ",".join([f"<{r}>" for r in requierds])
print(f"Internal Convention package is not installed.\n{messageBase.format_map({
print("Internal Convention package is not installed.\n", messageBase.format_map({
"module": moduleName,
"required": requierds_str
})}\n[{ConsoleFrontColor.RESET}{format_traceback_info(back=2)}{ConsoleFrontColor.RED}]")
}), "\n[",ConsoleFrontColor.RESET,format_traceback_info(back=2),ConsoleFrontColor.RED,"]")
def ReleaseFailed2Requirements():
global ImportingFailedSet

View File

@@ -327,7 +327,7 @@ class ToolFile(BaseModel):
except:
pass
with open(self.OriginFullPath, 'w', encoding='utf-8') as f:
json.dump(json_data, f, indent=4)
json.dump(json_data, f, indent=4, ensure_ascii=False)
return self
def SaveAsCsv(self, csv_data:"pd.DataFrame"):
'''

View File

@@ -228,7 +228,7 @@ class GlobalConfig:
return self
# 配置查找
def FindItem[T](self, key: str, default: Optional[T] = None) -> Optional[T]:
def FindItem(self, key: str, default: Optional[Any] = None) -> Optional[Any]:
"""查找配置项,支持默认值"""
if key in self._data_pair:
return self._data_pair[key]