Returns selected config based on the value of type. If type is not set (None), None is returned.
(self)
| 45 | return {'type': self.type, chosen_type: self._export_config(chosen_value)} |
| 46 | |
| 47 | def get(self): |
| 48 | """Returns selected config based on the value of type. |
| 49 | |
| 50 | If type is not set (None), None is returned. |
| 51 | """ |
| 52 | chosen_type = self.type |
| 53 | if chosen_type is None: |
| 54 | return None |
| 55 | if chosen_type not in self.__dict__: |
| 56 | raise ValueError('type: {!r} is not a valid key!'.format(self.type)) |
| 57 | return self.__dict__[chosen_type] |
no outgoing calls