1 #-------------------------------------------------------------------------
4 # Classes that inherit from Singleton can be instanciated only once
5 #-------------------------------------------------------------------------
8 def __init__(cls, name, bases, dic):
9 super(Singleton,cls).__init__(name,bases,dic)
12 def __call__(cls, *args, **kw):
13 if cls.instance is None:
14 cls.instance=super(Singleton,cls).__call__(*args,**kw)
19 # http://stackoverflow.com/questions/6760685/creating-a-singleton-in-python