__init__.py 文件源码

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

项目:tsrc 作者: SuperTanker 项目源码 文件源码
def find_workspace_path():
    """ Look for a workspace root somewhere in the upper directories
    hierarchy

    """
    head = os.getcwd()
    tail = True
    while tail:
        tsrc_path = os.path.join(head, ".tsrc")
        if os.path.isdir(tsrc_path):
            return path.Path(head)
        tbuild_yml_path = os.path.join(head, "tbuild.yml")
        if os.path.exists(tbuild_yml_path):
            return path.Path(head)

        else:
            head, tail = os.path.split(head)
    raise tsrc.Error("Could not find current workspace")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号