config.py 文件源码

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

项目:bittyband 作者: yam655 项目源码 文件源码
def find_project_dir(project):
    if project is None:
        project = "."
    root = get_project_root()
    if root is None:
        root = Path()
    project_dir = Path(project)
    if "." == project:
        project_dir = Path(".")
    elif "/" not in project and "\\" not in project:
        if "projects" in config:
            if project in config["projects"]:
                project_dir = Path(config["projects"].get(project))
        project_dir = root.joinpath(project_dir.expanduser())
    else:
        project_dir = project_dir.expanduser()
    if not project_dir.exists():
        project_dir = root.joinpath(project_dir)
    if project_dir.is_dir():
        project_dir = project_dir.resolve()
    return project_dir
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号