From 4ce1a90038b23d931858ad22815dbe29f74d7d98 Mon Sep 17 00:00:00 2001 From: Nat Williams Date: Fri, 13 Apr 2012 17:06:09 -0500 Subject: add Git Data API support --- pygithub3/resources/git_data.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 pygithub3/resources/git_data.py (limited to 'pygithub3/resources/git_data.py') 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 "" % getattr(self, 'content', '') + + +class Reference(Resource): + def __str__(self): + return '' % getattr(self, 'ref', '') + + +class Tag(Resource): + _maps = {'object': Commit, + 'tagger': Author,} # committer? tagger? + def __str__(self): + return '' % getattr(self, 'tag', '') + + +class Tree(Resource): + def __str__(self): + return '' % getattr(self, 'sha', '') -- cgit v1.2.3-59-g8ed1b