]>
git.ipfire.org Git - ipfire.org.git/blob - webapp/backend/misc.py
5 A class for using the singleton pattern
8 def __init__(cls
, name
, bases
, dict):
9 super(Singleton
, cls
).__init
__(name
, bases
, dict)
12 def __call__(cls
, *args
, **kw
):
13 if cls
.instance
is None:
14 cls
.instance
= super(Singleton
, cls
).__call
__(*args
, **kw
)