util.py 文件源码

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

项目:metatab 作者: Metatab 项目源码 文件源码
def declaration_path(name):
    """Return the path to an included declaration"""
    from os.path import dirname, join, exists
    import  metatabdecl
    from metatab.exc import IncludeError

    d = dirname(metatabdecl.__file__)

    path = join(d, name)

    if not exists(path):
        path = join(d, name + '.csv')

    if not exists(path):
        raise IncludeError("No local declaration file for name '{}' ".format(name))

    return path


# From http://stackoverflow.com/a/295466
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号