diff options
Diffstat (limited to 'pygithub3/resources/git_data.py')
-rw-r--r-- | pygithub3/resources/git_data.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pygithub3/resources/git_data.py b/pygithub3/resources/git_data.py new file mode 100644 index 0000000..4adcf5d --- /dev/null +++ b/pygithub3/resources/git_data.py @@ -0,0 +1,27 @@ +#!/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', '') |