action_editor.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:sc-controller 作者: kozec 项目源码 文件源码
def load_component(self, class_name):
        """
        Loads and adds new component to editor.
        Returns component instance.
        """
        if class_name in self.loaded_components:
            return self.loaded_components[class_name]
        mod = importlib.import_module("scc.gui.ae.%s" % (class_name,))
        for x in mod.__all__:
            cls = getattr(mod, x)
            if isinstance(cls, (type, types.ClassType)) and issubclass(cls, AEComponent):
                if cls is not AEComponent:
                    instance = cls(self.app, self)
                    self.loaded_components[class_name] = instance
                    self.components.append(instance)
                    return instance
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号