Esempio n. 1
0
    def _release_from_github_object(self, raw_release: PyGithubRelease,
                                    git_tag: GitTag) -> GithubRelease:
        """
        Get ogr.abstract.Release object from github.GithubRelease

        :param raw_release: GithubRelease, object from Github API
            https://developer.github.com/v3/repos/releases/
        :return: Release, example(type, value):
            tag_name: str, "v1.0.0"
            url: str, "https://api.github.com/repos/octocat/Hello-World/releases/1"
            created_at: datetime.datetime, 2018-09-19 12:56:26
            tarball_url: str, "https://api.github.com/repos/octocat/Hello-World/tarball/v1.0.0"
            git_tag: GitTag
            project: GithubProject
            raw_release: PyGithubRelease
        """
        return GithubRelease(
            tag_name=raw_release.tag_name,
            url=raw_release.url,
            created_at=str(raw_release.created_at),
            tarball_url=raw_release.tarball_url,
            git_tag=git_tag,
            project=self,
            raw_release=raw_release,
        )
Esempio n. 2
0
    def _release_from_github_object(self, raw_release: PyGithubRelease,
                                    git_tag: GitTag) -> GithubRelease:
        """
        Get ogr.abstract.Release object from github.GithubRelease

        Args:
            raw_release: GithubRelease, object from Github API
                https://developer.github.com/v3/repos/releases/

        Returns:
            Release object.
        """
        return GithubRelease(
            tag_name=raw_release.tag_name,
            url=raw_release.url,
            created_at=str(raw_release.created_at),
            tarball_url=raw_release.tarball_url,
            git_tag=git_tag,
            project=self,
            raw_release=raw_release,
        )