config.py 文件源码

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

项目:bittyband 作者: yam655 项目源码 文件源码
def get_project_root():
    """ Return the common base-directory for projects.

        This allows you to specify a `--project` on the command-line
        and to reference a project directory off of this root without adding
        a mapping in the `projects` section of the user configuration file.

        The value for this comes from a `root` symlink in the `--user-config`
        directory. If this is a file, instead of a directory, it needs to
        be the name of the directory. (It does '~' expansion.)

        The expectation is that this will allow a common `~/BittyProjects`
        or `~/Documents/BittyTunes` directory to root your projects.
    """
    global home_dir
    root = home_dir / "root"
    if root.is_file():
        t = root.read_text().strip()
        root = Path(t).expanduser()
    if root.is_dir():
        return root.resolve()
    return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号