aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/resources
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2012-04-17 18:45:46 +0200
committerDavid Medina <davidmedina9@gmail.com>2012-04-17 18:45:46 +0200
commit8430f64e6f0025b3d3d088ffd13c50b7123972f6 (patch)
tree214726395e1f0108e757a47d2c0de0ec36a3aeb5 /pygithub3/resources
parent:sparkles: Release 0.3 :sparkles: (diff)
parentadd myself to AUTHORS and some other docs tweaks (diff)
downloadpython-github3-8430f64e6f0025b3d3d088ffd13c50b7123972f6.tar.xz
python-github3-8430f64e6f0025b3d3d088ffd13c50b7123972f6.zip
Merged pull request #3 from natw/git_data
Diffstat (limited to 'pygithub3/resources')
-rw-r--r--pygithub3/resources/gists.py1
-rw-r--r--pygithub3/resources/git_data.py28
2 files changed, 29 insertions, 0 deletions
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
new file mode 100644
index 0000000..4d12e01
--- /dev/null
+++ b/pygithub3/resources/git_data.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+
+from .base import Resource
+from .repos import Author, Commit
+
+
+class Blob(Resource):
+ def __str__(self):
+ return "<Blob (%s)>" % getattr(self, 'content', '')
+
+
+class Reference(Resource):
+ def __str__(self):
+ return '<Reference (%s)>' % getattr(self, 'ref', '')
+
+
+class Tag(Resource):
+ _maps = {'object': Commit,
+ 'tagger': Author} # committer? tagger?
+
+ def __str__(self):
+ return '<Tag (%s)>' % getattr(self, 'tag', '')
+
+
+class Tree(Resource):
+ def __str__(self):
+ return '<Tree (%s)>' % getattr(self, 'sha', '')