Skip to content

Commit 15fd929

Browse files
committed
Updated example in README.rst to work with current version
1 parent f1a03e9 commit 15fd929

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

README.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@ Usage
1616

1717
::
1818

19-
import github3
19+
from github3.api import Github
20+
from github3.handlers.user import AuthUser
21+
from github3.handlers.gists import Gist
2022

21-
gh = github3.basic_auth('username', 'password')
23+
gh = Github()
24+
gh.session.auth = ('kennethreitz', 'password')
2225

23-
gh.get_repo('kennethreitz', 'python-github3')
26+
me = AuthUser(gh)
27+
for repo in me.get_repos():
28+
print repo
2429

25-
me = gh.get_me()
26-
27-
me.create_gist(u'Description',
28-
files={'file1.txt': {'content': u'Content of first file'}})
30+
gists = Gist(gh)
31+
gists.create_gist(
32+
u'Description',
33+
files={'file1.txt': {'content': u'Content of first file'}})
2934

3035

3136

0 commit comments

Comments
 (0)