[Mod] 改变Singleton的使用说明
This commit is contained in:
parent
0e67e75d6c
commit
70adba7637
@ -197,13 +197,11 @@ class BaseEngine(ABC):
|
||||
pass
|
||||
|
||||
|
||||
class LogEngine(BaseEngine):
|
||||
class LogEngine(BaseEngine, metaclass=Singleton):
|
||||
"""
|
||||
Processes log event and output with logging module.
|
||||
"""
|
||||
|
||||
__metaclass__ = Singleton
|
||||
|
||||
def __init__(self, main_engine: MainEngine, event_engine: EventEngine):
|
||||
""""""
|
||||
super(LogEngine, self).__init__(main_engine, event_engine, "log")
|
||||
|
@ -16,8 +16,9 @@ class Singleton(type):
|
||||
"""
|
||||
Singleton metaclass,
|
||||
|
||||
class A:
|
||||
__metaclass__ = Singleton
|
||||
usage:
|
||||
class A(metaclass=Singleton):
|
||||
...
|
||||
"""
|
||||
_instances = {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user