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) · 823 Bytes
/
Copy pathcomment.py
File metadata and controls
30 lines (21 loc) · 823 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 GistComment(BaseComment):
"""The :class:`GistComment <GistComment>` object. This represents a comment
on a gist.
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/gists/comments/
"""
def __init__(self, comment, session=None):
super(GistComment, 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) # (No coverage)
def __repr__(self):
return '<Gist Comment [{0}]>'.format(self.user.login)