Exemple #1
0
 def _issuecomment_from_gitlab_object(raw_comment) -> IssueComment:
     return IssueComment(
         comment=raw_comment.body,
         author=raw_comment.author["username"],
         created=raw_comment.created_at,
         edited=raw_comment.updated_at,
     )
Exemple #2
0
 def _issuecomment_from_pagure_dict(self, comment_dict: dict) -> IssueComment:
     return IssueComment(
         comment=comment_dict["comment"],
         author=comment_dict["user"]["name"],
         created=datetime.datetime.fromtimestamp(int(comment_dict["date_created"])),
         edited=None,
     )
Exemple #3
0
 def _issuecomment_from_github_object(
         raw_comment: GithubIssueComment) -> IssueComment:
     return IssueComment(
         comment=raw_comment.body,
         author=raw_comment.user.login,
         created=raw_comment.created_at,
         edited=raw_comment.updated_at,
     )
Exemple #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 IssueComment(comment=body, author=self._username)
Exemple #5
0
 def issue_comment(cls, original_object: Any, issue_id: int,
                   body: str) -> "IssueComment":
     issue = original_object.get_issue(issue_id)
     log_output(issue)
     return IssueComment(
         parent=issue,
         body=body,
         author=cls.author,
         created=datetime.datetime.now(),
         edited=datetime.datetime.now(),
     )