Utilities¶
Package-wide useful routines¶
-
class
orion.core.utils.
Factory
(name, bases, namespace, **kwargs)[source]¶ Instantiate appropriate wrapper for the infrastructure based on input argument,
of_type
.- Attributes
- typesdict of subclasses of
cls.__base__
Updated to contain all possible implementations currently. Check out code.
- typesdict of subclasses of
Methods
__call__
(of_type, *args, **kwargs)Create an object, instance of
cls.__base__
, on first call.-
__call__
(of_type, *args, **kwargs)[source]¶ Create an object, instance of
cls.__base__
, on first call.- Parameters
of_type – Name of class, subclass of
cls.__base__
, wrapper of a database framework that will be instantiated on the first call.args – positional arguments to initialize
cls.__base__
’s instance (if any)kwargs – keyword arguments to initialize
cls.__base__
’s instance (if any)
See also
Factory.types keys for values of argument of_type.
See also
Attributes of
cls.__base__
andcls.__base__.__init__
for values of args and kwargs.Note
New object is saved as
Factory
’s internal state.- Returns
The object which was created on the first call.