Return remote path of this file (if staging is required) else None.
336889
def __remote_path_rewrite(self, dataset_path, dataset_path_type, name=None):
        
        path = str(dataset_path)  # Use false_path if needed.
        action = self.action_mapper.action(path, dataset_path_type)
        if action.staging_needed:
            if name is None:
                name = os.path.basename(path)
            remote_directory = self.__remote_directory(dataset_path_type)
            remote_path_rewrite = self.path_helper.remote_join(remote_directory, name)
        else:
            # Actions which don't require staging MUST define a path_rewrite
            # method.
            remote_path_rewrite = action.path_rewrite(self.path_helper)

        return remote_path_rewrite
557979
def remote_url(self, remotename='origin'):
        
        cmd = ['git', 'config', 'remote.%s.url' % remotename]
        return self.sh(cmd, shell=False,
                       ignore_error=True).strip()
1006035
def _get_parent_remote_paths(self):
        
        parent_paths = set([item.get_remote_parent_path() for item in self.file_urls])
        if '' in parent_paths:
            parent_paths.remove('')
        return parent_paths
406301
def _get_path():
    """"""
    if _path:
        return _path[0]
    environ_paths = set(os.environ['PATH'].split(':'))
    environ_paths.add('/usr/local/bin')
    environ_paths.add('/usr/bin')
    _path.append(':'.join(environ_paths))
    logger.debug('PATH = %s', _path[-1])
    return _path[0]
1033861
def get_remote(self, remote='origin'):
        """"""
        repo = self.get_repo()
        if repo is not None:
            remotes = {r.name: r for r in repo.remotes}
            r = repo.remotes[0] if remote not in remotes else remotes[remote]
        else:
            r = None
        return r
1200404
def get_filepath(self, renew=False):
        
        if self._location is None or renew:
            self._location = '.'
        return path.join(self._location, self.get_filename())
755772
def determine_path():
    """"""
    root = __file__
    if os.path.islink(root):
        root = os.path.realpath(root)
    return os.path.dirname(os.path.abspath(root))
271551
def capture_file_path(self):
        

        if self._capture_file_name:
            return os.path.join(self._project.captures_directory, self._capture_file_name)
        else:
            return None
1178678
def remote_root(self):
    """"""
    return os.path.relpath(self.address.spec_path, self.target_base)
746234
def walk(self, dirpath):
        """"""
        if self.is_ssh(dirpath):
            self._check_ftp()
            remotepath = self._get_remote(dirpath)
            return self._sftp_walk(remotepath)
        else:
            return os.walk(dirpath)
260864
def _remote_folder(dirpath, remotes, syn):
    
    if dirpath in remotes:
        return remotes[dirpath], remotes
    else:
        parent_dir, cur_dir = os.path.split(dirpath)
        parent_folder, remotes = _remote_folder(parent_dir, remotes, syn)
        s_cur_dir = syn.store(synapseclient.Folder(cur_dir, parent=parent_folder))
        remotes[dirpath] = s_cur_dir.id
        return s_cur_dir.id, remotes
134677
def scr_path(self):
        """"""
        # Lazy property to avoid multiple calls to has_abiext.
        try:
            return self._scr_path
        except AttributeError:
            path = self.outdir.has_abiext("SCR.nc")
            if path: self._scr_path = path
            return path
637618
def _get_path(self, file):
        """"""
        dir = self._cache_directory()
        if not os.path.exists(dir):
            os.makedirs(dir)
        return os.path.join(dir, file)
587072
def _get_relative_path(self, full_path):
        """"""
        try:
            rel_path = Path(full_path).relative_to(Path().absolute())
        except ValueError:
            LOG.error("%s: Couldn't find relative path of '%s' from '%s'.",
                      self.name, full_path, Path().absolute())
            return full_path
        return str(rel_path)
1048154
def _get_remote(self, cached=True):
        '''
        
        '''

        return self.m(
            'getting current remote',
            cmdd=dict(
                cmd='git remote show %s' % ('-n' if cached else ''),
                cwd=self.local
            ),
            verbose=False
        )
1101092
def path(self, which=None):
        
        if which == 'deploy':
            return '{0}/{1}'.format(
                super(RHCIDeployment, self).path(which='self'),
                which
            )
        return super(RHCIDeployment, self).path(which)
1135832
def get_remote_file(url):
    
    try:
        return requests.get(url)
    except requests.exceptions.ConnectionError as e:
        print("Connection error!")
        print(e.message.reason)
        exit(1)