aboutsummaryrefslogtreecommitdiffstats
path: root/github3/models.py
diff options
context:
space:
mode:
authorAntti Kaihola <akaihol+github@ambitone.com>2011-11-07 14:38:55 +0200
committerAntti Kaihola <akaihol+github@ambitone.com>2011-11-07 14:38:55 +0200
commit6d7b6547d48c66c607a2e674034cef662a08e2f7 (patch)
treec91e7c021630d692be7e4d3afc4ed21c9748b230 /github3/models.py
parent_post_resource (diff)
downloadpython-github3-6d7b6547d48c66c607a2e674034cef662a08e2f7.tar.xz
python-github3-6d7b6547d48c66c607a2e674034cef662a08e2f7.zip
Added the create_gist() method
Diffstat (limited to 'github3/models.py')
-rw-r--r--github3/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/github3/models.py b/github3/models.py
index 3c86687..8c4f9ba 100644
--- a/github3/models.py
+++ b/github3/models.py
@@ -113,6 +113,14 @@ class User(BaseResource):
def gists(self):
return self._gh._get_resources(('users', self.login, 'gists'), Gist)
+ def create_gist(self, description, public=True, files={}):
+ data = {'description': description,
+ 'public': public,
+ 'files': files}
+ deploy = json.dumps(data)
+ return self._gh._post_resource(('users', self.login, 'gists'), Gist, deploy)
+
+
class CurrentUser(User):
"""Github Current User object model."""