Hacker, Robots, Congregations now singletons.

This commit is contained in:
sfigato 2019-06-30 21:23:11 +02:00
parent 7e6b757e3a
commit 1be1aac9d0
Signed by: blallo
GPG Key ID: 0CBE577C9B72DC3F

View File

@ -122,6 +122,12 @@ class Hackers(Entry):
"""
kind = "ou"
_instance = None
def __new__(cls, *args, **kwargs):
if cls._instance is None:
cls._instance = object.__new__(cls)
return cls._instance
def __init__(self, client, *args, **kwargs):
super().__init__(client)
@ -142,6 +148,12 @@ class Robots(Entry):
kind = "ou"
_name = "Services"
_instance = None
def __new__(cls, *args, **kwargs):
if cls._instance is None:
cls._instance = object.__new__(cls)
return cls._instance
def __init__(self, client, *args, **kwargs):
super().__init__(client)
@ -162,6 +174,12 @@ class Congregations(Entry):
kind = "ou"
_name = "Groups"
_instance = None
def __new__(cls, *args, **kwargs):
if cls._instance is None:
cls._instance = object.__new__(cls)
return cls._instance
def __init__(self, client, *args, **kwargs):
super().__init__(client)