示例#1
0
    def parse_widget(self, config):
        type_cls = utils.load_class_by_string(config['type'])

        if issubclass(type_cls, DynamicWidget):
            config['backend'] = utils.add_dicts(
                self.backend_dict,
                config.get('backend', {}))

        config_cls = Config.for_type(config['type'])
        return config_cls(config)
示例#2
0
 def test_for_type(self):
     self.assertTrue(
         Config.for_type('diamondash.tests.test_config.ToyConfigurable')
         is ToyConfig)