diff options
-rw-r--r-- | docs/git_data.rst | 86 | ||||
-rw-r--r-- | docs/services.rst | 1 | ||||
-rw-r--r-- | pygithub3/requests/git_data/blobs.py | 2 | ||||
-rw-r--r-- | pygithub3/requests/git_data/tags.py | 1 | ||||
-rw-r--r-- | pygithub3/resources/gists.py | 1 | ||||
-rw-r--r-- | pygithub3/resources/git_data.py | 3 | ||||
-rw-r--r-- | pygithub3/services/git_data/commits.py | 2 |
7 files changed, 91 insertions, 5 deletions
diff --git a/docs/git_data.rst b/docs/git_data.rst new file mode 100644 index 0000000..549420b --- /dev/null +++ b/docs/git_data.rst @@ -0,0 +1,86 @@ +.. _Git Data service: + +Git Data services +================= + +**Example**:: + + from pygithub3 import Github + + gh = Github(user='someone', repo='some_repo') + + a_blob = gh.git_data.blobs.get('a long sha') + + dev_branch = gh.git_data.references.get('heads/add_a_thing') + + +GitData +------- + +.. autoclass:: pygithub3.services.git_data.GitData + :members: + + .. attribute:: blobs + + :ref:`Blobs service` + + .. attribute:: commits + + :ref:`Commits service` + + .. attribute:: references + + :ref:`References service` + + .. attribute:: tags + + :ref:`Tags service` + + .. attribute:: trees + + :ref:`Trees service` + + +.. _Blobs service: + +Blobs +----- + +.. autoclass:: pygithub3.services.git_data.Blobs + :members: + + +.. _Commits service: + +Commits +------- + +.. autoclass:: pygithub3.services.git_data.Commits + :members: + + +.. _References service: + +References +---------- + +.. autoclass:: pygithub3.services.git_data.References + :members: + + +.. _Tags service: + +Tags +---- + +.. autoclass:: pygithub3.services.git_data.Tags + :members: + + +.. _Trees service: + +Trees +----- + +.. autoclass:: pygithub3.services.git_data.Trees + :members: diff --git a/docs/services.rst b/docs/services.rst index 71fa690..2fbd2ee 100644 --- a/docs/services.rst +++ b/docs/services.rst @@ -72,5 +72,6 @@ List of services users repos gists + git_data .. _mimetypes: http://developer.github.com/v3/mime diff --git a/pygithub3/requests/git_data/blobs.py b/pygithub3/requests/git_data/blobs.py index 9ce500a..a4bddd6 100644 --- a/pygithub3/requests/git_data/blobs.py +++ b/pygithub3/requests/git_data/blobs.py @@ -14,5 +14,5 @@ class Create(Request): resource = Blob body_schema = { 'schema': ('content', 'encoding'), - 'required': ('content', 'encoding'), #TODO: is enc really required? + 'required': ('content', 'encoding'), # TODO: is enc really required? } diff --git a/pygithub3/requests/git_data/tags.py b/pygithub3/requests/git_data/tags.py index 8b37f0e..dbc8da4 100644 --- a/pygithub3/requests/git_data/tags.py +++ b/pygithub3/requests/git_data/tags.py @@ -13,4 +13,3 @@ class Create(Request): 'schema': ('tag', 'message', 'object', 'type', 'tagger'), 'required': ('type',), } - diff --git a/pygithub3/resources/gists.py b/pygithub3/resources/gists.py index 7e9550a..89425bf 100644 --- a/pygithub3/resources/gists.py +++ b/pygithub3/resources/gists.py @@ -15,6 +15,7 @@ class Fork(Resource): _dates = ('created_at', ) _maps = {'user': User} + def __str__(self): return '<GistFork>' diff --git a/pygithub3/resources/git_data.py b/pygithub3/resources/git_data.py index 4adcf5d..4d12e01 100644 --- a/pygithub3/resources/git_data.py +++ b/pygithub3/resources/git_data.py @@ -17,7 +17,8 @@ class Reference(Resource): class Tag(Resource): _maps = {'object': Commit, - 'tagger': Author,} # committer? tagger? + 'tagger': Author} # committer? tagger? + def __str__(self): return '<Tag (%s)>' % getattr(self, 'tag', '') diff --git a/pygithub3/services/git_data/commits.py b/pygithub3/services/git_data/commits.py index 4debd95..25e8775 100644 --- a/pygithub3/services/git_data/commits.py +++ b/pygithub3/services/git_data/commits.py @@ -31,5 +31,3 @@ class Commits(Service): self.make_request('git_data.commits.create', user=user, repo=repo, body=data) ) - - |