コード例 #1
0
 def _get_all_comments(self) -> List[IssueComment]:
     self.__update()
     raw_comments = self._raw_issue["comments"]
     return [
         PagureIssueComment(parent=self, raw_comment=raw_comment)
         for raw_comment in raw_comments
     ]
コード例 #2
0
ファイル: issue.py プロジェクト: AdarLavi/ogr
 def comment(self, body: str) -> IssueComment:
     payload = {"comment": body}
     self.project._call_project_api(
         "issue", str(self.id), "comment", data=payload, method="POST"
     )
     self.__dirty = True
     return PagureIssueComment(parent=self, body=body, author=self.project._user)
コード例 #3
0
 def get_comment(self, comment_id: int) -> IssueComment:
     return PagureIssueComment(
         self.project._call_project_api("issue",
                                        str(self.id),
                                        "comment",
                                        str(comment_id),
                                        method="GET"))
コード例 #4
0
 def issue_comment(self, issue_id: int, body: str) -> IssueComment:
     payload = {"comment": body}
     self._call_project_api("issue",
                            str(issue_id),
                            "comment",
                            data=payload,
                            method="POST")
     return PagureIssueComment(comment=body, author=self._username)
コード例 #5
0
 def _get_all_issue_comments(self, issue_id: int) -> List[IssueComment]:
     raw_comments = self._call_project_api("issue",
                                           str(issue_id))["comments"]
     return [
         PagureIssueComment(raw_comment) for raw_comment in raw_comments
     ]