diff options
author | 2011-11-09 13:05:10 +0200 | |
---|---|---|
committer | 2011-11-09 13:05:10 +0200 | |
commit | 15fd9291bf32cf027b490adc6f03856c28f3ab64 (patch) | |
tree | 142ac0b492d38869602c48468553a0c2c169eaf4 | |
parent | Merged create_gist() into current HEAD of copitux/develop (diff) | |
download | python-github3-15fd9291bf32cf027b490adc6f03856c28f3ab64.tar.xz python-github3-15fd9291bf32cf027b490adc6f03856c28f3ab64.zip |
Updated example in README.rst to work with current version
-rw-r--r-- | README.rst | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -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'}}) |