Skip to content

Commit 30c1cec

Browse files
author
Nat Williams
committed
add docs and a few little pep8 tweaks
1 parent f1e781f commit 30c1cec

File tree

7 files changed

+91
-5
lines changed

7 files changed

+91
-5
lines changed

docs/git_data.rst

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
.. _Git Data service:
2+
3+
Git Data services
4+
=================
5+
6+
**Example**::
7+
8+
from pygithub3 import Github
9+
10+
gh = Github(user='someone', repo='some_repo')
11+
12+
a_blob = gh.git_data.blobs.get('a long sha')
13+
14+
dev_branch = gh.git_data.references.get('heads/add_a_thing')
15+
16+
17+
GitData
18+
-------
19+
20+
.. autoclass:: pygithub3.services.git_data.GitData
21+
:members:
22+
23+
.. attribute:: blobs
24+
25+
:ref:`Blobs service`
26+
27+
.. attribute:: commits
28+
29+
:ref:`Commits service`
30+
31+
.. attribute:: references
32+
33+
:ref:`References service`
34+
35+
.. attribute:: tags
36+
37+
:ref:`Tags service`
38+
39+
.. attribute:: trees
40+
41+
:ref:`Trees service`
42+
43+
44+
.. _Blobs service:
45+
46+
Blobs
47+
-----
48+
49+
.. autoclass:: pygithub3.services.git_data.Blobs
50+
:members:
51+
52+
53+
.. _Commits service:
54+
55+
Commits
56+
-------
57+
58+
.. autoclass:: pygithub3.services.git_data.Commits
59+
:members:
60+
61+
62+
.. _References service:
63+
64+
References
65+
----------
66+
67+
.. autoclass:: pygithub3.services.git_data.References
68+
:members:
69+
70+
71+
.. _Tags service:
72+
73+
Tags
74+
----
75+
76+
.. autoclass:: pygithub3.services.git_data.Tags
77+
:members:
78+
79+
80+
.. _Trees service:
81+
82+
Trees
83+
-----
84+
85+
.. autoclass:: pygithub3.services.git_data.Trees
86+
:members:

docs/services.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@ List of services
7272
users
7373
repos
7474
gists
75+
git_data
7576

7677
.. _mimetypes: http://developer.github.com/v3/mime

pygithub3/requests/git_data/blobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ class Create(Request):
1414
resource = Blob
1515
body_schema = {
1616
'schema': ('content', 'encoding'),
17-
'required': ('content', 'encoding'), #TODO: is enc really required?
17+
'required': ('content', 'encoding'), # TODO: is enc really required?
1818
}

pygithub3/requests/git_data/tags.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ class Create(Request):
1313
'schema': ('tag', 'message', 'object', 'type', 'tagger'),
1414
'required': ('type',),
1515
}
16-

pygithub3/resources/gists.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Fork(Resource):
1515

1616
_dates = ('created_at', )
1717
_maps = {'user': User}
18+
1819
def __str__(self):
1920
return '<GistFork>'
2021

pygithub3/resources/git_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ def __str__(self):
1717

1818
class Tag(Resource):
1919
_maps = {'object': Commit,
20-
'tagger': Author,} # committer? tagger?
20+
'tagger': Author} # committer? tagger?
21+
2122
def __str__(self):
2223
return '<Tag (%s)>' % getattr(self, 'tag', '')
2324

pygithub3/services/git_data/commits.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,3 @@ def create(self, data, user=None, repo=None):
3131
self.make_request('git_data.commits.create', user=user, repo=repo,
3232
body=data)
3333
)
34-
35-

0 commit comments

Comments
 (0)