コード例 #1
0
ファイル: GitHubIssue.py プロジェクト: RaiVaibhav/IGitt
    def reopen(self):
        """
        Reopens the issue.

        :raises RuntimeError: If something goes wrong (network, auth...).
        """
        self.data = patch(self._token, self._url, {'state': 'open'})
コード例 #2
0
ファイル: GitHubIssue.py プロジェクト: RaiVaibhav/IGitt
    def title(self, new_title):
        """
        Sets the title of the issue.

        :param new_title: The new title.
        """
        self.data = patch(self._token, self._url, {'title': new_title})
コード例 #3
0
ファイル: GitHubIssue.py プロジェクト: RaiVaibhav/IGitt
    def close(self):
        """
        Closes the issue.

        :raises RuntimeError: If something goes wrong (network, auth...).
        """
        self.data = patch(self._token, self._url, {'state': 'closed'})
コード例 #4
0
    def body(self, value: str):
        """
        Sets comment body to value on GitHub.

        :param value: A string containing comment body.
        """
        payload = {'body': value}
        self.data = patch(self._token, self._url, payload)
コード例 #5
0
ファイル: GitHubIssue.py プロジェクト: RaiVaibhav/IGitt
    def description(self, new_description):
        """
        Sets the description of the issue.

        :param new_description: The new description.
        """
        self.data = patch(self._token,
                          self._url,
                          {'body': new_description})
コード例 #6
0
ファイル: GitHubIssue.py プロジェクト: RaiVaibhav/IGitt
    def labels(self, value: Set[str]):
        """
        Sets the labels to the given set of labels.

        :param value: A set of label texts.
        """
        # Only if self.data is populated we actually save a request here
        if 'labels' in self.data and value == self.labels:
            return  # No need to patch

        self.data = patch(self._token, self._url, {'labels': list(value)})
コード例 #7
0
 def mark_done(self):
     """
     Marks the notification as done/read.
     """
     patch(self._token, self._url, {})
     self.data.update({'unread': False})