cli.py 文件源码

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

项目:BoerOPS 作者: BoerOPS 项目源码 文件源码
def do_custom(self):
        in_obj = cli.custom_actions[self.cls_name][self.action][2]

        # Get the object (lazy), then act
        if in_obj:
            data = {}
            if hasattr(self.mgr, '_from_parent_attrs'):
                for k in self.mgr._from_parent_attrs:
                    data[k] = self.args[k]
            if gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(self.cls):
                data[self.cls._id_attr] = self.args.pop(self.cls._id_attr)
            o = self.cls(self.mgr, data)
            method_name = self.action.replace('-', '_')
            return getattr(o, method_name)(**self.args)
        else:
            return getattr(self.mgr, self.action)(**self.args)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号