From 82776a8c75a1cd15d764926b1647b1ea24c18a5f Mon Sep 17 00:00:00 2001 From: David Medina Date: Tue, 3 Apr 2012 07:55:43 +0200 Subject: "services.gists.Gist" tests and resources --- pygithub3/resources/gists.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pygithub3/resources/gists.py (limited to 'pygithub3/resources/gists.py') diff --git a/pygithub3/resources/gists.py b/pygithub3/resources/gists.py new file mode 100644 index 0000000..8345f84 --- /dev/null +++ b/pygithub3/resources/gists.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 -*- + +from .base import Resource +from .users import User + + +class File(Resource): + + def __str__(self): + return '' % getattr(self, 'filename', '') + + +class Fork(Resource): + + _dates = ('created_at', ) + _maps = {'user': User} + def __str__(self): + return '' + + +class History(Resource): + + _dates = ('committed_at', ) + _maps = {'user': User} + + def __str__(self): + return '' % getattr(self, 'version', '') + +class Gist(Resource): + + _dates = ('created_at', ) + _maps = {'user': User} + _collection_maps = {'files': File, 'forks': Fork, 'history': History} + + def __str__(self): + return '' % getattr(self, 'description', '') -- cgit v1.2.3-59-g8ed1b