forked from sigmavirus24/github3.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomment.py
More file actions
30 lines (21 loc) · 840 Bytes
/
Copy pathcomment.py
File metadata and controls
30 lines (21 loc) · 840 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
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)
#: :class:`User <github3.users.User>` who made the comment
self.user = None
if comment.get('user'):
self.user = User(comment.get('user'), self)
def __repr__(self):
return '<Issue Comment [{0}]>'.format(self.user.login)