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)
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))
def __init__(self, data): self.path = configlib.user_config_path() self.data = data
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)