MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / __constructor

Function __constructor

web/pgadmin/utils/dynamic_registry/__init__.py:16–35  ·  view source on GitHub ↗
(self, name, bases, kwargs)

Source from the content-addressed store, hash-verified

14
15# Constructor
16def __constructor(self, name, bases, kwargs):
17 # Register this type of auth_sources, based on the module name
18 # Avoid registering the BaseAuthentication itself
19 cls = self.__class__
20 entry = self._decorate_cls_name(name, kwargs)
21
22 if cls._registry is None:
23 cls._registry = dict()
24 else:
25 if entry in cls._registry:
26 raise RuntimeError((
27 "{} class is already been registered with {} "
28 "(package: {})"
29 ).format(entry, cls._name_, cls._package_))
30
31 if cls._initialized is True:
32 cls._registry[entry] = self
33 cls._initialized = True
34
35 ABCMeta.__init__(self, name, bases, kwargs)
36
37
38@classmethod

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected