]> git.ipfire.org Git - ipfire.org.git/blob - webapp/backend/misc.py
Remove obsolete pakfire CGI scripts.
[ipfire.org.git] / webapp / backend / misc.py
1 #!/usr/bin/python
2
3 class Singleton(type):
4 """
5 A class for using the singleton pattern
6 """
7
8 def __init__(cls, name, bases, dict):
9 super(Singleton, cls).__init__(name, bases, dict)
10 cls.instance = None
11
12 def __call__(cls, *args, **kw):
13 if cls.instance is None:
14 cls.instance = super(Singleton, cls).__call__(*args, **kw)
15
16 return cls.instance