Module ogr.services.pagure.comments

Classes

class PagureComment (raw_comment: Any | None = None,
parent: Any | None = None,
body: str | None = None,
id_: int | None = None,
author: str | None = None,
created: datetime.datetime | None = None,
edited: datetime.datetime | None = None)
Expand source code
class PagureComment(Comment):
    def _from_raw_comment(self, raw_comment: dict[str, Any]) -> None:
        self._body = raw_comment["comment"]
        self._id = raw_comment["id"]
        self._author = raw_comment["user"]["name"]
        self._created = self.__datetime_from_timestamp(raw_comment["date_created"])
        self._edited = self.__datetime_from_timestamp(raw_comment["edited_on"])

    @staticmethod
    def __datetime_from_timestamp(
        timestamp: Optional[str],
    ) -> Optional[datetime.datetime]:
        return datetime.datetime.fromtimestamp(int(timestamp)) if timestamp else None

    @property
    def body(self) -> str:
        return self._body

    @body.setter
    def body(self, new_body: str) -> None:
        raise OperationNotSupported()

Ancestors

Subclasses

Inherited members

class PagureIssueComment (raw_comment: Any | None = None,
parent: Any | None = None,
body: str | None = None,
id_: int | None = None,
author: str | None = None,
created: datetime.datetime | None = None,
edited: datetime.datetime | None = None)
Expand source code
class PagureIssueComment(PagureComment, IssueComment):
    def __str__(self) -> str:
        return "Pagure" + super().__str__()

Ancestors

Inherited members

class PagurePRComment (raw_comment: Any | None = None,
parent: Any | None = None,
body: str | None = None,
id_: int | None = None,
author: str | None = None,
created: datetime.datetime | None = None,
edited: datetime.datetime | None = None)
Expand source code
class PagurePRComment(PagureComment, PRComment):
    def __str__(self) -> str:
        return "Pagure" + super().__str__()

Ancestors

Inherited members