Source code for oi_cli2.utils.Singleton
[docs]def Singleton(cls):
__instances = {}
def wrapper(*args, **kwargs):
if cls not in __instances:
__instances[cls] = cls(*args, **kwargs)
return __instances[cls]
return wrapper
[docs]def Singleton(cls):
__instances = {}
def wrapper(*args, **kwargs):
if cls not in __instances:
__instances[cls] = cls(*args, **kwargs)
return __instances[cls]
return wrapper