def get_change(connection: GithubConnection, org: str, repo: str, pull: int) -> Change: p = Project("%s/%s" % (org, repo), connection.source) github = connection.getGithubClient(p.name) pr = github.pull_request(org, repo, pull) sha = pr.head.sha return conn._getChange(p, pull, sha, True)
def _getWebUrl(self, project: Project, sha: str=None) -> str: return self.gitweb_url_template.format( baseurl=self.baseurl, project=project.getSafeAttributes(), sha=sha)
def getProject(self, name): p = self.connection.getProject(name) if not p: p = Project(name, self) self.connection.addProject(p) return p