This method returns the object based on register object type else return not implemented error Args: name: object type for which object to be returned. **kwargs: N number of parameters
(cls, name, **kwargs)
| 57 | |
| 58 | @classmethod |
| 59 | def get_object(cls, name, **kwargs): |
| 60 | """ |
| 61 | This method returns the object based on register object type |
| 62 | else return not implemented error |
| 63 | |
| 64 | Args: |
| 65 | name: object type for which object to be returned. |
| 66 | **kwargs: N number of parameters |
| 67 | """ |
| 68 | |
| 69 | if name in ObjectRegistry.registry: |
| 70 | return (ObjectRegistry.registry[name])(**kwargs) |
| 71 | |
| 72 | raise NotImplementedError( |
| 73 | gettext("This feature has not been implemented for object " |
| 74 | "type '{0}'.").format(name) |
| 75 | ) |
| 76 | |
| 77 | |
| 78 | class BaseCommand(metaclass=ObjectRegistry): |
no test coverage detected