forked from sigmavirus24/github3.py
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcomment.py
More file actions
33 lines (23 loc) · 930 Bytes
/
Copy pathcomment.py
File metadata and controls
33 lines (23 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
from github3.models import BaseComment
from github3.users import User
class IssueComment(BaseComment):
"""The :class:`IssueComment <IssueComment>` object. This structures and
handles the comments on issues specifically.
Two comment instances can be checked like so::
c1 == c2
c1 != c2
And is equivalent to::
c1.id == c2.id
c1.id != c2.id
See also: http://developer.github.com/v3/issues/comments/
"""
def __init__(self, comment, session=None):
super(IssueComment, self).__init__(comment, session)
user = comment.get('user')
#: :class:`User <github3.users.User>` who made the comment
self.user = User(user, self) if user else None
#: Issue url (not a template)
self.issue_url = comment.get('issue_url')
def __repr__(self):
return '<Issue Comment [{0}]>'.format(self.user.login)