Exemple #1
0
    def reopen(self):
        """
        Reopens the issue.

        :raises RuntimeError: If something goes wrong (network, auth...).
        """
        self.data = patch(self._token, self._url, {'state': 'open'})
Exemple #2
0
    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})
Exemple #3
0
    def close(self):
        """
        Closes the issue.

        :raises RuntimeError: If something goes wrong (network, auth...).
        """
        self.data = patch(self._token, self._url, {'state': 'closed'})
Exemple #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)
Exemple #5
0
    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})
Exemple #6
0
    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)})
Exemple #7
0
 def mark_done(self):
     """
     Marks the notification as done/read.
     """
     patch(self._token, self._url, {})
     self.data.update({'unread': False})