aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/resources/gists.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2012-04-04 00:07:50 +0200
committerDavid Medina <davidmedina9@gmail.com>2012-04-04 00:07:50 +0200
commit3e551e6801a0031f1482ad5d9f30af9df78e9471 (patch)
tree9d28cc75691279ff75f079cd4e085e77241517af /pygithub3/resources/gists.py
parent:sparkles: Relase 0.2 :sparkles: (diff)
parentFix bug (diff)
downloadpython-github3-3e551e6801a0031f1482ad5d9f30af9df78e9471.tar.xz
python-github3-3e551e6801a0031f1482ad5d9f30af9df78e9471.zip
Gists service done
Diffstat (limited to 'pygithub3/resources/gists.py')
-rw-r--r--pygithub3/resources/gists.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/pygithub3/resources/gists.py b/pygithub3/resources/gists.py
new file mode 100644
index 0000000..7e9550a
--- /dev/null
+++ b/pygithub3/resources/gists.py
@@ -0,0 +1,45 @@
+#!/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', '')
+
+class Comment(Resource):
+
+ _dates = ('created_at', )
+ _maps = {'user': User}
+
+ def __str__(self):
+ return '<GistComment (%s)>' % getattr(self, 'user', '')