Skip to content

Commit c463aa3

Browse files
committed
Reformat client.Github docstring for use in Sphinx.
1 parent 767157d commit c463aa3

3 files changed

Lines changed: 20 additions & 18 deletions

File tree

doc/api/client.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Creating a client
22
=================
33

4+
.. autoclass:: github2.client.Github
5+
:members:
6+
7+
Examples
8+
--------
9+
410
There are three ways to authenticate to the GitHub API. If you want to use your
511
username and API token, use::
612

doc/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,5 @@
215215
('index', 'python-github2', u'python-github2 Documentation',
216216
[u'Ask Solem'], 1)
217217
]
218+
219+
autoclass_content = "init"

github2/client.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,20 @@ def __init__(self, username=None, api_token=None, debug=False,
1212
"""
1313
An interface to GitHub's API:
1414
http://develop.github.com/
15-
16-
Params:
17-
`username` is your own GitHub username.
18-
19-
`api_token` can be found here (while logged in as that user):
20-
https://github.com/account
21-
22-
`access_token` can be used when no ``username`` and/or ``api_token``
23-
is used. The ``access_token`` is the OAuth access token that is
24-
received after successful OAuth authentication.
25-
26-
`requests_per_second` is a float indicating the API rate limit
27-
you're operating under (1 per second per GitHub at the moment),
28-
or None to disable delays.
2915
30-
The default is to disable delays (for backwards compatibility).
31-
32-
`cache` is a directory for caching GitHub responses.
16+
:param str username: your own GitHub username.
17+
:param str api_token: can be found at https://github.com/account
18+
(while logged in as that user):
19+
:param str access_token: can be used when no ``username`` and/or
20+
``api_token`` is used. The ``access_token`` is the OAuth access
21+
token that is received after successful OAuth authentication.
22+
:param float requests_per_second: indicate the API rate limit you're
23+
operating under (1 per second per GitHub at the moment),
24+
or None to disable delays. The default is to disable delays (for
25+
backwards compatibility).
26+
:param str cache: a directory for caching GitHub responses.
3327
"""
34-
28+
3529
self.debug = debug
3630
self.request = GithubRequest(username=username, api_token=api_token,
3731
debug=self.debug,

0 commit comments

Comments
 (0)