コード例 #1
0
def remote_dir(name=None):
    # Use directory containing user config to store remote info.
    rest_path = [name] if name else []
    config_path = config.user_config_path()
    if config_path:
        return os.path.join(os.path.dirname(config_path), "remotes", *rest_path)
    return path("remotes", name)
コード例 #2
0
ファイル: remote_util.py プロジェクト: wangsd01/guildai
def config_path(path):
    """Returns an absolute path for a config-relative path.

    Variable and user refs are resolved in path.

    If path is None, returns None.
    """
    if path is None:
        return None
    expanded = os.path.expanduser(os.path.expandvars(path))
    config_dir = os.path.dirname(config.user_config_path())
    return os.path.abspath(os.path.join(config_dir, expanded))
コード例 #3
0
 def __init__(self, data):
     self.path = configlib.user_config_path()
     self.data = data
コード例 #4
0
def remote_dir(name=None):
    # Use directory containing user config to store remote info.
    config_path = config.user_config_path()
    return os.path.join(os.path.dirname(config_path), "remotes", name)