BS 0.1.0 解除部分报错
This commit is contained in:
@@ -22,7 +22,7 @@ class IConvertModel[T](IConvertable[T], IModel):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
class SingletonModel[T](IModel):
|
class SingletonModel[T](IModel):
|
||||||
_InjectInstances:Dict[type,object] = {}
|
_InjectInstances:Dict[type,Any] = {}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def GetInstance(t:Typen[T]) -> T:
|
def GetInstance(t:Typen[T]) -> T:
|
||||||
@@ -106,10 +106,10 @@ class Architecture:
|
|||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
_RegisterHistory: Set[type] = set()
|
_RegisterHistory: Set[type] = set()
|
||||||
_UncompleteTargets: Dict[type,object] = {}
|
_UncompleteTargets: Dict[type,Any] = {}
|
||||||
_Completer: Dict[type,Action] = {}
|
_Completer: Dict[type,Action] = {}
|
||||||
_Dependences: Dict[type,DependenceModel] = {}
|
_Dependences: Dict[type,DependenceModel] = {}
|
||||||
_Childs: Dict[type,object] = {}
|
_Childs: Dict[type,Any] = {}
|
||||||
|
|
||||||
class Registering(IConvertModel[bool]):
|
class Registering(IConvertModel[bool]):
|
||||||
def __init__(self,registerSlot:type) -> None:
|
def __init__(self,registerSlot:type) -> None:
|
||||||
@@ -149,7 +149,7 @@ class Architecture:
|
|||||||
cls._UncompleteTargets.pop(complete, None)
|
cls._UncompleteTargets.pop(complete, None)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def Register(cls, slot:type, target:object, completer:Action, *dependences:type) -> 'Architecture.Registering':
|
def Register(cls, slot:type, target:Any, completer:Action, *dependences:type) -> 'Architecture.Registering':
|
||||||
if slot in cls._RegisterHistory:
|
if slot in cls._RegisterHistory:
|
||||||
raise InvalidOperationError("Illegal duplicate registrations")
|
raise InvalidOperationError("Illegal duplicate registrations")
|
||||||
|
|
||||||
@@ -183,11 +183,11 @@ class Architecture:
|
|||||||
return cls.Contains(type(T))
|
return cls.Contains(type(T))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def InternalGet(cls, type_:type) -> object:
|
def InternalGet(cls, type_:type) -> Any:
|
||||||
return cls._Childs[type_]
|
return cls._Childs[type_]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def Get(cls, type_:type) -> object:
|
def Get(cls, type_:type) -> Any:
|
||||||
return cls.InternalGet(type_)
|
return cls.InternalGet(type_)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Reference in New Issue
Block a user