aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2012-04-03 23:18:52 +0200
committerDavid Medina <davidmedina9@gmail.com>2012-04-03 23:18:52 +0200
commit37e871617148bfde801a499699bbf2205125d830 (patch)
treec38c9fded3b56554d2a22fe1f7712dab9be6dca9
parentFix naming (diff)
downloadpython-github3-37e871617148bfde801a499699bbf2205125d830.tar.xz
python-github3-37e871617148bfde801a499699bbf2205125d830.zip
Gists services doc
-rw-r--r--docs/gists.rst37
-rw-r--r--docs/services.rst1
-rw-r--r--pygithub3/services/gists/__init__.py20
-rw-r--r--pygithub3/services/gists/comments.py7
4 files changed, 65 insertions, 0 deletions
diff --git a/docs/gists.rst b/docs/gists.rst
new file mode 100644
index 0000000..3b2915f
--- /dev/null
+++ b/docs/gists.rst
@@ -0,0 +1,37 @@
+.. _Gists service:
+
+Gists services
+===============
+
+**Fast sample**::
+
+ from pygithub3 import Github
+
+ auth = dict(login='octocat', password='pass')
+ gh = Github(**auth)
+
+ octocat_gists = gh.gists.list()
+ the_first_gist = gh.gists.get(1)
+
+ the_first_gist_comments = gh.gists.comments.list(1)
+
+Gist
+-----
+
+.. autoclass:: pygithub3.services.gists.Gist
+ :members:
+
+ .. attribute:: comments
+
+ :ref:`Comments service`
+
+.. _Comments service:
+
+Comments
+----------
+
+.. autoclass:: pygithub3.services.gists.Comments
+ :members:
+
+.. _github gists doc: http://developer.github.com/v3/gists
+.. _github comments doc: http://developer.github.com/v3/gists/comments
diff --git a/docs/services.rst b/docs/services.rst
index a0fd894..e686a6e 100644
--- a/docs/services.rst
+++ b/docs/services.rst
@@ -61,5 +61,6 @@ List of services
users
repos
+ gists
.. _mimetypes: http://developer.github.com/v3/mime
diff --git a/pygithub3/services/gists/__init__.py b/pygithub3/services/gists/__init__.py
index 5fbfe7a..aadb136 100644
--- a/pygithub3/services/gists/__init__.py
+++ b/pygithub3/services/gists/__init__.py
@@ -96,6 +96,10 @@ class Gist(Service):
""" Star a gist
:param int id: Gist id
+
+ .. warning ::
+ You must be authenticated
+
"""
request = self.request_builder('gists.star', id=id)
self._put(request)
@@ -104,6 +108,10 @@ class Gist(Service):
""" Unstar a gist
:param int id: Gist id
+
+ .. warning ::
+ You must be authenticated
+
"""
request = self.request_builder('gists.unstar', id=id)
return self._delete(request)
@@ -112,6 +120,10 @@ class Gist(Service):
""" Check if a gist is starred
:param int id: Gist id
+
+ .. warning ::
+ You must be authenticated
+
"""
request = self.request_builder('gists.is_starred', id=id)
return self._bool(request)
@@ -120,6 +132,10 @@ class Gist(Service):
""" Fork a gist
:param int id: Gist id
+
+ .. warning ::
+ You must be authenticated
+
"""
request = self.request_builder('gists.fork', id=id)
@@ -129,6 +145,10 @@ class Gist(Service):
""" Delete a gist
:param int id: Gist id
+
+ .. warning ::
+ You must be authenticated
+
"""
request = self.request_builder('gists.delete', id=id)
return self._delete(request)
diff --git a/pygithub3/services/gists/comments.py b/pygithub3/services/gists/comments.py
index 397d583..7f4955f 100644
--- a/pygithub3/services/gists/comments.py
+++ b/pygithub3/services/gists/comments.py
@@ -39,6 +39,7 @@ class Comments(Service, MimeTypeMixin):
You must be authenticated
::
+
comment_service.create(1, 'comment')
"""
request = self.request_builder('gists.comments.create',
@@ -50,6 +51,9 @@ class Comments(Service, MimeTypeMixin):
:param int id: Comment id
:param str message: Comment's message
+
+ .. warning::
+ You must be authenticated
"""
request = self.request_builder('gists.comments.update', id=id,
body={'body': message})
@@ -59,6 +63,9 @@ class Comments(Service, MimeTypeMixin):
""" Delete a comment
:param int id: Comment id
+
+ .. warning::
+ You must be authenticated
"""
request = self.request_builder('gists.comments.delete', id=id)
self._delete(request)