Ejemplo n.º 1
0
    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
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
    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
Ejemplo n.º 4
0
    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
Ejemplo n.º 5
0
    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
Ejemplo n.º 6
0
 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
Ejemplo n.º 7
0
 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