urltool.py 文件源码

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

项目:Codado 作者: corydodt 项目源码 文件源码
def fromObject(cls, obj, decode=None):
        orig = Documentation.fromObject(obj, decode)
        self = cls(orig.raw)
        lines = self.raw.splitlines()
        if '---' in lines:
            n = lines.index('---')
            this, that = '\n'.join(lines[:n]), '\n'.join(lines[n:])
            self.yamlData = {}
            for ydoc in yaml.load_all(that):
                assert isinstance(ydoc, dict), "only dict-like structures allowed in yaml docstrings not %r" % type(ydoc)
                self.yamlData.update(ydoc)
        else:
            this = '\n'.join(lines)
        self.raw = this
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号