mirror of
https://github.com/kennethreitz-archive/github2.git
synced 2026-06-05 15:40:19 +00:00
Added support for getting blob/tree metadata (as described in http://develop.github.com/p/object.html)
This commit is contained in:
@@ -16,3 +16,12 @@ class Github(object):
|
||||
def project_for_user_repo(self, user, repo):
|
||||
return "/".join([user, repo])
|
||||
|
||||
def get_blob_info(self, project, tree_sha, path):
|
||||
blob = self.request.get("blob/show", project, tree_sha, path)
|
||||
return blob.get("blob")
|
||||
|
||||
def get_tree(self, project, tree_sha):
|
||||
tree = self.request.get("tree/show", project, tree_sha)
|
||||
return tree.get("tree", [])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user