Skip to content

Commit 37e8716

Browse files
committed
Gists services doc
1 parent 1abcce9 commit 37e8716

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed

docs/gists.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.. _Gists service:
2+
3+
Gists services
4+
===============
5+
6+
**Fast sample**::
7+
8+
from pygithub3 import Github
9+
10+
auth = dict(login='octocat', password='pass')
11+
gh = Github(**auth)
12+
13+
octocat_gists = gh.gists.list()
14+
the_first_gist = gh.gists.get(1)
15+
16+
the_first_gist_comments = gh.gists.comments.list(1)
17+
18+
Gist
19+
-----
20+
21+
.. autoclass:: pygithub3.services.gists.Gist
22+
:members:
23+
24+
.. attribute:: comments
25+
26+
:ref:`Comments service`
27+
28+
.. _Comments service:
29+
30+
Comments
31+
----------
32+
33+
.. autoclass:: pygithub3.services.gists.Comments
34+
:members:
35+
36+
.. _github gists doc: http://developer.github.com/v3/gists
37+
.. _github comments doc: http://developer.github.com/v3/gists/comments

docs/services.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@ List of services
6161

6262
users
6363
repos
64+
gists
6465

6566
.. _mimetypes: http://developer.github.com/v3/mime

pygithub3/services/gists/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ def star(self, id):
9696
""" Star a gist
9797
9898
:param int id: Gist id
99+
100+
.. warning ::
101+
You must be authenticated
102+
99103
"""
100104
request = self.request_builder('gists.star', id=id)
101105
self._put(request)
@@ -104,6 +108,10 @@ def unstar(self, id):
104108
""" Unstar a gist
105109
106110
:param int id: Gist id
111+
112+
.. warning ::
113+
You must be authenticated
114+
107115
"""
108116
request = self.request_builder('gists.unstar', id=id)
109117
return self._delete(request)
@@ -112,6 +120,10 @@ def is_starred(self, id):
112120
""" Check if a gist is starred
113121
114122
:param int id: Gist id
123+
124+
.. warning ::
125+
You must be authenticated
126+
115127
"""
116128
request = self.request_builder('gists.is_starred', id=id)
117129
return self._bool(request)
@@ -120,6 +132,10 @@ def fork(self, id):
120132
""" Fork a gist
121133
122134
:param int id: Gist id
135+
136+
.. warning ::
137+
You must be authenticated
138+
123139
"""
124140

125141
request = self.request_builder('gists.fork', id=id)
@@ -129,6 +145,10 @@ def delete(self, id):
129145
""" Delete a gist
130146
131147
:param int id: Gist id
148+
149+
.. warning ::
150+
You must be authenticated
151+
132152
"""
133153
request = self.request_builder('gists.delete', id=id)
134154
return self._delete(request)

pygithub3/services/gists/comments.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def create(self, gist_id, message):
3939
You must be authenticated
4040
4141
::
42+
4243
comment_service.create(1, 'comment')
4344
"""
4445
request = self.request_builder('gists.comments.create',
@@ -50,6 +51,9 @@ def update(self, id, message):
5051
5152
:param int id: Comment id
5253
:param str message: Comment's message
54+
55+
.. warning::
56+
You must be authenticated
5357
"""
5458
request = self.request_builder('gists.comments.update', id=id,
5559
body={'body': message})
@@ -59,6 +63,9 @@ def delete(self, id):
5963
""" Delete a comment
6064
6165
:param int id: Comment id
66+
67+
.. warning::
68+
You must be authenticated
6269
"""
6370
request = self.request_builder('gists.comments.delete', id=id)
6471
self._delete(request)

0 commit comments

Comments
 (0)