Compare commits
5 Commits
3fa432a2bb
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| efd826f677 | |||
| ad17b905c4 | |||
| 4ba5bfdfee | |||
| 8121899d32 | |||
| a79ba69443 |
@@ -131,15 +131,16 @@ class Architecture:
|
|||||||
if slot in cls._RegisteringRuntime:
|
if slot in cls._RegisteringRuntime:
|
||||||
raise InvalidOperationError("Illegal duplicate registrations")
|
raise InvalidOperationError("Illegal duplicate registrations")
|
||||||
cls._RegisteringRuntime[slot] = Architecture.Registering(slot, target, DependenceModel(Architecture.TypeQuery(dependence) for dependence in dependences), action)
|
cls._RegisteringRuntime[slot] = Architecture.Registering(slot, target, DependenceModel(Architecture.TypeQuery(dependence) for dependence in dependences), action)
|
||||||
|
dependences = cls._RegisteringRuntime[slot].dependences
|
||||||
cls._InternalRegisteringComplete()
|
cls._InternalRegisteringComplete()
|
||||||
return cls._RegisteringRuntime[slot].dependences
|
return dependences
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def Contains(cls, type_:type) -> bool:
|
def Contains(cls, type_:type) -> bool:
|
||||||
return type_ in cls._RegisteredObjects
|
return type_ in cls._RegisteredObjects
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def Get(cls, type_:type) -> Any:
|
def Get[T](cls, type_:Typen[T]) -> T:
|
||||||
return cls._RegisteredObjects[type_]
|
return cls._RegisteredObjects[type_]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -187,10 +187,10 @@ def InternalImportingThrow(
|
|||||||
):
|
):
|
||||||
with lock_guard():
|
with lock_guard():
|
||||||
requierds_str = ",".join([f"<{r}>" for r in requierds])
|
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,
|
"module": moduleName,
|
||||||
"required": requierds_str
|
"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():
|
def ReleaseFailed2Requirements():
|
||||||
global ImportingFailedSet
|
global ImportingFailedSet
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ class ToolFile(BaseModel):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
with open(self.OriginFullPath, 'w', encoding='utf-8') as f:
|
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
|
return self
|
||||||
def SaveAsCsv(self, csv_data:"pd.DataFrame"):
|
def SaveAsCsv(self, csv_data:"pd.DataFrame"):
|
||||||
'''
|
'''
|
||||||
@@ -504,12 +504,11 @@ class ToolFile(BaseModel):
|
|||||||
return result
|
return result
|
||||||
def DirWalk(
|
def DirWalk(
|
||||||
self,
|
self,
|
||||||
top,
|
|
||||||
topdown: bool = True,
|
topdown: bool = True,
|
||||||
onerror: Optional[Callable] = None,
|
onerror: Optional[Callable] = None,
|
||||||
followlinks: bool = False
|
followlinks: bool = False
|
||||||
) -> Iterator[tuple[dir_name_type, list[dir_name_type], list[file_name_type]]]:
|
) -> Iterator[tuple[dir_name_type, list[dir_name_type], list[file_name_type]]]:
|
||||||
return os.walk(self.OriginFullPath, top=top, topdown=topdown, onerror=onerror, followlinks=followlinks)
|
return os.walk(self.OriginFullPath, topdown=topdown, onerror=onerror, followlinks=followlinks)
|
||||||
|
|
||||||
|
|
||||||
def bool(self):
|
def bool(self):
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ class GlobalConfig:
|
|||||||
return self
|
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:
|
if key in self._data_pair:
|
||||||
return self._data_pair[key]
|
return self._data_pair[key]
|
||||||
|
|||||||
Reference in New Issue
Block a user