Ejemplo n.º 1
0
    def remove_repo(self, rname):
        """todo: Docstring for remove_repo

        :param repo: arg description
        :type repo: type description
        :return:
        :rtype:
        """
        logger.debug("%s", rname)
        repo = Repo(name=rname)
        repo.remove()

        return repo
Ejemplo n.º 2
0
    def remove_repo(self, rname):
        """todo: Docstring for remove_repo

        :param repo: arg description
        :type repo: type description
        :return:
        :rtype:
        """
        logger.debug("%s", rname)
        repo = Repo(name=rname)
        repo.remove()

        return repo
Ejemplo n.º 3
0
    def install_repo(self, repo, location=''):
        """todo: Docstring for install_repo
        :param repo: arg description
        :type repo: type description
        :return:
        :rtype:
        """

        dst = location or settings.upkg_destdir

        # make sure the destination dir exists.
        if not os.path.exists(dst):
            os.makedirs(dst)

        # repo = Repo(url=repo, repo_dir=dst)
        repo = Repo(url=repo)
        repo.install()

        return repo
Ejemplo n.º 4
0
    def update(self, repos):
        """

        :param repos: arg description
        :type repos: type description
        :return:
        :rtype:
        """
        logger.debug("repos: %s", repos)

        if repos:
            rlist = [Repo(name=x) for x in repos]
        else:
            # Update them all!
            rlist = Repo.installed_list()

        logger.debug("repo list: %s", rlist)

        for r in rlist:
            logger.debug("calling update on: %s", r)
            r.update()
Ejemplo n.º 5
0
    def exec(self, args):
        """todo: Docstring for exec

        :param args: arg description
        :type args: type description
        :return:
        :rtype:
        """

        logger.debug("query %s", args.query)

        pl = Repo.installed_list()
        if not pl:
            print("No packages installed, use 'upkg install'")

        idx = 1
        for p in pl:
            print("[%s] %s" % (idx, p))
            idx += 1
Ejemplo n.º 6
0
    def exec(self, args):
        """todo: Docstring for exec

        :param args: arg description
        :type args: type description
        :return:
        :rtype:
        """

        logger.debug("query %s", args.query)

        pl = Repo.installed_list()
        if not pl:
            print("No packages installed, use 'upkg install'")

        idx = 1
        for p in pl:
            print("[%s] %s" % (idx, p))
            idx += 1
Ejemplo n.º 7
0
    def update(self, repos):
        """

        :param repos: arg description
        :type repos: type description
        :return:
        :rtype:
        """
        logger.debug("repos: %s", repos)

        if repos:
            rlist = [Repo(name=x) for x in repos]
        else:
            # Update them all!
            rlist = Repo.installed_list()

        logger.debug("repo list: %s", rlist)

        for r in rlist:
            logger.debug("calling update on: %s", r)
            r.update()
Ejemplo n.º 8
0
    def status(self, repos):
        """

        :param repos: arg description
        :type repos: type description
        :return:
        :rtype:
        """
        logger.debug("repos: %s", repos)

        if repos:
            rlist = [Repo(name=x) for x in repos]
        else:
            # Update them all!
            rlist = Repo.installed_list()

        logger.debug("repo list: %s", rlist)

        t = Terminal()
        for r in rlist:
            logger.debug("calling status on: %s", r)
            rp = r.repo_dir

            rpw = len(rp)
            w = t.width
            bw = int(((w - rpw) / 2) - 1)
            nw = int(((w - len(r.name)) / 2) - 1)
            print(t.magenta("*" * w))
            print(t.magenta("{} {} {}".format(" " * nw, r.name, " " * nw)))
            if (rpw + 2) < w:
                print(t.magenta("{} {} {}".format(" " * bw, rp, " " * bw)))
            else:
                print(t.magenta(rpw))
            print(t.magenta("*" * w))

            r.status()
            print("\n")