aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/requests/repos/commits.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2012-02-18 16:40:08 +0100
committerDavid Medina <davidmedina9@gmail.com>2012-02-18 16:40:08 +0100
commit1c832e9cdd1f11b0ef91eb63f5a6e434999f9db4 (patch)
tree1df1a177a724e188b2edeaba6ed45062cc2b4919 /pygithub3/requests/repos/commits.py
parentSupport to resources-self-nested into collections (diff)
downloadpython-github3-1c832e9cdd1f11b0ef91eb63f5a6e434999f9db4.tar.xz
python-github3-1c832e9cdd1f11b0ef91eb63f5a6e434999f9db4.zip
Repos commits added
Diffstat (limited to 'pygithub3/requests/repos/commits.py')
-rw-r--r--pygithub3/requests/repos/commits.py64
1 files changed, 64 insertions, 0 deletions
diff --git a/pygithub3/requests/repos/commits.py b/pygithub3/requests/repos/commits.py
new file mode 100644
index 0000000..49df2a1
--- /dev/null
+++ b/pygithub3/requests/repos/commits.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+
+from . import Request
+from pygithub3.resources.repos import Commit, GitCommit, Comment, Diff
+
+
+class List(Request):
+
+ uri = 'repos/{user}/{repo}/commits'
+ resource = GitCommit
+
+
+class Get(Request):
+
+ uri = 'repos/{user}/{repo}/commits/{sha}'
+ resource = Commit
+
+
+class List_comments(Request):
+
+ uri = 'repos/{user}/{repo}/comments'
+ resource = Comment
+
+ def clean_uri(self):
+ if self.sha:
+ return 'repos/{user}/{repo}/commits/{sha}/comments'
+
+
+class Create_comment(Request):
+
+ uri = 'repos/{user}/{repo}/commits/{sha}/comments'
+ resource = Comment
+ body_schema = {
+ 'schema': ('body', 'commit_id', 'line', 'path', 'position'),
+ 'required': ('body', 'commit_id', 'line', 'path', 'position'),
+ }
+
+
+class Get_comment(Request):
+
+ uri = 'repos/{user}/{repo}/comments/{comment_id}'
+ resource = Comment
+
+
+class Update_comment(Request):
+
+ uri = 'repos/{user}/{repo}/comments/{comment_id}'
+ resource = Comment
+ body_schema = {
+ 'schema': ('body', ),
+ 'required': ('body', ),
+ }
+
+
+class Compare(Request):
+
+ uri = 'repos/{user}/{repo}/compare/{base}...{head}'
+ resource = Diff
+
+
+class Delete_comment(Request):
+
+ uri = 'repos/{user}/{repo}/comments/{comment_id}'