mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Improve documentation
This commit is contained in:
+1
-1
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user