aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/resources/gists.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2012-04-03 07:55:43 +0200
committerDavid Medina <davidmedina9@gmail.com>2012-04-03 07:55:43 +0200
commit82776a8c75a1cd15d764926b1647b1ea24c18a5f (patch)
treec7d0d45156963a1a43c55b5a4fc14537e5b09185 /pygithub3/resources/gists.py
parent:sparkles: Relase 0.2 :sparkles: (diff)
downloadpython-github3-82776a8c75a1cd15d764926b1647b1ea24c18a5f.tar.xz
python-github3-82776a8c75a1cd15d764926b1647b1ea24c18a5f.zip
"services.gists.Gist" tests and resources
Diffstat (limited to 'pygithub3/resources/gists.py')
-rw-r--r--pygithub3/resources/gists.py37
1 files changed, 37 insertions, 0 deletions
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 '<GistFile (%s)>' % getattr(self, 'filename', '')
+
+
+class Fork(Resource):
+
+ _dates = ('created_at', )
+ _maps = {'user': User}
+ def __str__(self):
+ return '<GistFork>'
+
+
+class History(Resource):
+
+ _dates = ('committed_at', )
+ _maps = {'user': User}
+
+ def __str__(self):
+ return '<GistHistory (%s)>' % getattr(self, 'version', '')
+
+class Gist(Resource):
+
+ _dates = ('created_at', )
+ _maps = {'user': User}
+ _collection_maps = {'files': File, 'forks': Fork, 'history': History}
+
+ def __str__(self):
+ return '<Gist (%s)>' % getattr(self, 'description', '')