aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Kaihola <akaihol+github@ambitone.com>2011-11-09 13:05:10 +0200
committerAntti Kaihola <akaihol+github@ambitone.com>2011-11-09 13:05:10 +0200
commit15fd9291bf32cf027b490adc6f03856c28f3ab64 (patch)
tree142ac0b492d38869602c48468553a0c2c169eaf4
parentMerged create_gist() into current HEAD of copitux/develop (diff)
downloadpython-github3-15fd9291bf32cf027b490adc6f03856c28f3ab64.tar.xz
python-github3-15fd9291bf32cf027b490adc6f03856c28f3ab64.zip
Updated example in README.rst to work with current version
-rw-r--r--README.rst19
1 files changed, 12 insertions, 7 deletions
diff --git a/README.rst b/README.rst
index c924c4b..1686d89 100644
--- a/README.rst
+++ b/README.rst
@@ -16,16 +16,21 @@ Usage
::
- import github3
+ from github3.api import Github
+ from github3.handlers.user import AuthUser
+ from github3.handlers.gists import Gist
- gh = github3.basic_auth('username', 'password')
+ gh = Github()
+ gh.session.auth = ('kennethreitz', 'password')
- gh.get_repo('kennethreitz', 'python-github3')
+ me = AuthUser(gh)
+ for repo in me.get_repos():
+ print repo
- me = gh.get_me()
-
- me.create_gist(u'Description',
- files={'file1.txt': {'content': u'Content of first file'}})
+ gists = Gist(gh)
+ gists.create_gist(
+ u'Description',
+ files={'file1.txt': {'content': u'Content of first file'}})