Skip to content

Commit fbc49f1

Browse files
Ask SolemAsk Solem
authored andcommitted
Added support for getting blob/tree metadata (as described in http://develop.github.com/p/object.html)
1 parent 7b88d36 commit fbc49f1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

github2/client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ def __init__(self, username, api_token):
1616
def project_for_user_repo(self, user, repo):
1717
return "/".join([user, repo])
1818

19+
def get_blob_info(self, project, tree_sha, path):
20+
blob = self.request.get("blob/show", project, tree_sha, path)
21+
return blob.get("blob")
22+
23+
def get_tree(self, project, tree_sha):
24+
tree = self.request.get("tree/show", project, tree_sha)
25+
return tree.get("tree", [])
26+
27+

0 commit comments

Comments
 (0)