projects
/
mqtt-noolite.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Незначительно причесан код (убраны дублирующиеся строки).
[mqtt-noolite.git]
/
nmd
/
utils.py
1
class Singleton(type):
2
_instances = {}
3
4
def __call__(cls, *args, **kwargs):
5
if cls not in cls._instances:
6
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
7
return cls._instances[cls]