aboutsummaryrefslogtreecommitdiffstats
path: root/github3/models/gists.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2011-12-03 20:07:07 +0100
committerDavid Medina <davidmedina9@gmail.com>2011-12-03 20:07:07 +0100
commitc1dad1ab5856e7e559cc2b2eaa7c8acb231981d1 (patch)
treef760a889eada0fe0d8cf8cadd8c19fa42c9b783b /github3/models/gists.py
parentFix bugs (diff)
parentComplete AuthGist handler (diff)
downloadpython-github3-c1dad1ab5856e7e559cc2b2eaa7c8acb231981d1.tar.xz
python-github3-c1dad1ab5856e7e559cc2b2eaa7c8acb231981d1.zip
Merge branch 'develop'
Diffstat (limited to 'github3/models/gists.py')
-rw-r--r--github3/models/gists.py29
1 files changed, 25 insertions, 4 deletions
diff --git a/github3/models/gists.py b/github3/models/gists.py
index d1b416d..8979dbb 100644
--- a/github3/models/gists.py
+++ b/github3/models/gists.py
@@ -1,11 +1,26 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
-#
-# author: David Medina
from .base import BaseResource
from .user import User
+
+class GistComment(BaseResource):
+ """ Gist comment """
+
+ @classmethod
+ def idl(self):
+ return {
+ 'strs': ['url', 'body', 'body_text', 'body_html'],
+ 'ints': ['id'],
+ 'maps': {'user': User},
+ 'dates': ['created_at'],
+ }
+
+ def __repr__(self):
+ return '<GistComment %s>' % self.user.login
+
+
class File(BaseResource):
""" File model """
@@ -19,6 +34,7 @@ class File(BaseResource):
def __repr__(self):
return '<File gist> %s' % self.filename
+
class GistFork(BaseResource):
""" GistFork model """
@@ -33,6 +49,7 @@ class GistFork(BaseResource):
def __repr__(self):
return '<Gist fork> %s>' % self.user.login
+
class ChangeStatus(BaseResource):
""" ChangeStatus model """
@@ -45,6 +62,7 @@ class ChangeStatus(BaseResource):
def __repr__(self):
return '<Gist history> change_status>'
+
class GistHistory(BaseResource):
""" """
@@ -59,18 +77,21 @@ class GistHistory(BaseResource):
def __repr__(self):
return '<GistHistory %s/%s>' % (self.user, self.committed_at)
+
class Gist(BaseResource):
""" """
@classmethod
def idl(self):
return {
- 'strs': ['url', 'description', 'html_url', 'git_pull_url', 'git_push_url'],
+ 'strs': ['url', 'description', 'html_url', 'git_pull_url',
+ 'git_push_url'],
'ints': ['id', 'comments'],
'bools': ['public'],
'dates': ['created_at'],
'maps': {'user': User},
- 'collection_maps': {'files': File, 'forks': GistFork, 'history': GistHistory},
+ 'collection_maps': {'files': File, 'forks': GistFork,
+ 'history': GistHistory},
}
def __repr__(self):