コード例 #1
0
ファイル: run_util.py プロジェクト: olliethomas/guildai
def _try_format_peerpath(dir, cwd):
    cwd_parent = os.path.dirname(cwd)
    if cwd_parent == dir:
        return ".." + os.path.sep
    try:
        subpath = util.subpath(dir, cwd_parent)
    except ValueError:
        return None
    else:
        return os.path.join("..", subpath)
コード例 #2
0
ファイル: run_util.py プロジェクト: olliethomas/guildai
def _try_format_subpath(dir, cwd):
    try:
        return util.subpath(dir, cwd)
    except ValueError:
        return None