def _get_repo_fetcher_and_target(self, repo, dir_): """Returns a :class:`Fetcher` for ``repo``, and the destination dir at which the downloaded repo will be created. :param str repo: The repo url. :param str dir_: Directory into which the repo will be downloaded. :return: 2-tuple of (:class:`Fetcher`, :class:`path`) """ u = self.url[len(self.NAMESPACE) + 1:] if '@' in u: u = u.split('@')[0] if getattr(self, 'revision', ''): f = get_fetcher("{}@{}".format(repo, self.revision)) else: f = get_fetcher(repo) return f, path(dir_) / u
def _get_repo_fetcher_and_target(self, repo, dir_): """Returns a :class:`Fetcher` for ``repo``, and the destination dir at which the downloaded repo will be created. :param str repo: The repo url. :param str dir_: Directory into which the repo will be downloaded. :return: 2-tuple of (:class:`Fetcher`, :class:`path`) """ u = self.url[len(self.NAMESPACE) + 1:] f = get_fetcher(repo) return f, path(dir_) / u
def _get_repo_fetcher_and_target(self, repo, dir_): """Returns a :class:`Fetcher` for ``repo``, and the destination dir at which the downloaded repo will be created. :param str repo: The repo url. :param str dir_: Directory into which the repo will be downloaded. :return: 2-tuple of (:class:`Fetcher`, :class:`path`) """ u = self.url[len(self.NAMESPACE) + 1:] f = get_fetcher(repo) if hasattr(f, "repo"): basename = path(f.repo).name.splitext()[0] else: basename = u return f, path(dir_) / basename
def fetch(self, dir_): if hasattr(self, "path"): return super(InterfaceFetcher, self).fetch(dir_) elif hasattr(self, "repo"): # use the github fetcher for now u = self.url[10:] f = get_fetcher(self.repo) if hasattr(f, "repo"): basename = path(f.repo).name.splitext()[0] else: basename = u res = f.fetch(dir_) target = dir_ / basename if res != target: target.rmtree_p() path(res).rename(target) return target