Improve documentation

This commit is contained in:
Vincent Jacques
2013-02-16 21:15:17 +01:00
parent 680490a6d8
commit 0bd00452e7
15 changed files with 97 additions and 106 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ DEFAULT_TIMEOUT = 10
class Github(object):
"""
This class represents Githubs as returned for example by http://developer.github.com/v3/todo
This is the main class you instanciate to access the Github API v3. Optional parameters allow different authentication methods.
"""
def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT, client_id=None, client_secret=None, user_agent=None):
-1
View File
@@ -16,7 +16,6 @@
class InputFileContent(object):
"""
This class represents InputFileContents as returned for example by http://developer.github.com/v3/todo
"""
def __init__(self, content):
-1
View File
@@ -16,7 +16,6 @@
class InputGitAuthor(object):
"""
This class represents InputGitAuthors as returned for example by http://developer.github.com/v3/todo
"""
def __init__(self, name, email, date):
-1
View File
@@ -18,7 +18,6 @@ import github.GithubObject
class InputGitTreeElement(object):
"""
This class represents InputGitTreeElements as returned for example by http://developer.github.com/v3/todo
"""
def __init__(self, path, mode, type, content=github.GithubObject.NotSet, sha=github.GithubObject.NotSet):
+4 -4
View File
@@ -70,19 +70,19 @@ class PaginatedListBase:
class PaginatedList(PaginatedListBase):
"""
This class abstracts the `pagination of the API <http://developer.github.com/v3/todo>`_.
This class abstracts the `pagination of the API <http://developer.github.com/v3/#pagination>`_.
You can simply enumerate through instances of this class:
You can simply enumerate through instances of this class::
for repo in user.get_repos():
print repo.name
You can also index them or take slices:
You can also index them or take slices::
second_repo = user.get_repos()[1]
first_repos = user.get_repos()[:10]
And if you really need it, you can explicitely access a specific page:
And if you really need it, you can explicitely access a specific page::
some_repos = user.get_repos().get_page(0)
some_other_repos = user.get_repos().get_page(3)