Exemplo n.º 1
0
    def get_releases(self, repo):
        """Return a list of releases dicts for a given GitHub repo. repo must
        be of the form 'user/repo'"""
        releases = None
        curl_opts = self.env.get("curl_opts")
        github = autopkglib.github.GitHubSession(self.env["CURL_PATH"], curl_opts)
        releases_uri = f"/repos/{repo}/releases"
        (releases, status) = github.call_api(releases_uri)
        if status != 200:
            raise ProcessorError(f"Unexpected GitHub API status code {status}.")

        if not releases:
            raise ProcessorError(f"No releases found for repo '{repo}'")

        return releases
Exemplo n.º 2
0
    def get_releases(self, repo):
        """Return a list of releases dicts for a given GitHub repo. repo must
        be of the form 'user/repo'"""
        # pylint: disable=no-self-use
        releases = None
        github = autopkglib.github.GitHubSession()
        releases_uri = "/repos/%s/releases" % repo
        (releases, status) = github.call_api(releases_uri)
        if status != 200:
            raise ProcessorError("Unexpected GitHub API status code %s." % status)

        if not releases:
            raise ProcessorError("No releases found for repo '%s'" % repo)

        return releases
Exemplo n.º 3
0
    def get_releases(self, repo):
        """Return a list of releases dicts for a given GitHub repo. repo must
        be of the form 'user/repo'"""
        #pylint: disable=no-self-use
        releases = None
        github = autopkglib.github.GitHubSession()
        releases_uri = "/repos/%s/releases" % repo
        (releases, status) = github.call_api(releases_uri)
        if status != 200:
            raise ProcessorError("Unexpected GitHub API status code %s." %
                                 status)

        if not releases:
            raise ProcessorError("No releases found for repo '%s'" % repo)

        return releases
    def get_downloads(self, repo):
        """Return a list of downloads dicts for a given GitHub repo. repo must
        be of the form 'user/repo'"""
        #pylint: disable=no-self-use
        downloads = None
        github = autopkglib.github.GitHubSession()
        downloads_uri = "/repos/%s/downloads" % repo
        try:
            (downloads, status) = github.call_api(downloads_uri)
        # Catch a 404
        except urllib2.HTTPError as err:
            raise ProcessorError("GitHub API returned an error: '%s'." % err)
        if status != 200:
            raise ProcessorError(
                "Unexpected GitHub API status code %s." % status)

        if not downloads:
            raise ProcessorError("No downloads found for repo '%s'" % repo)

        return downloads
    def get_downloads(self, repo):
        """Return a list of downloads dicts for a given GitHub repo. repo must
        be of the form 'user/repo'"""
        #pylint: disable=no-self-use
        downloads = None
        github = autopkglib.github.GitHubSession()
        downloads_uri = "/repos/%s/downloads" % repo
        try:
            (downloads, status) = github.call_api(downloads_uri)
        # Catch a 404
        except urllib2.HTTPError as err:
            raise ProcessorError("GitHub API returned an error: '%s'." % err)
        if status != 200:
            raise ProcessorError("Unexpected GitHub API status code %s." %
                                 status)

        if not downloads:
            raise ProcessorError("No downloads found for repo '%s'" % repo)

        return downloads