diff options
author | 2011-07-23 23:18:17 -0400 | |
---|---|---|
committer | 2011-07-23 23:18:17 -0400 | |
commit | 97d85351bb0c8a0d2e49db3e77c31541faa25eff (patch) | |
tree | c00864eca543a342ffe98fa0047fb87ecc75ba2e /github3/core.py | |
parent | get_me (diff) | |
download | python-github3-97d85351bb0c8a0d2e49db3e77c31541faa25eff.tar.xz python-github3-97d85351bb0c8a0d2e49db3e77c31541faa25eff.zip |
basic auth -- that was easy :)
Diffstat (limited to 'github3/core.py')
-rw-r--r-- | github3/core.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/github3/core.py b/github3/core.py index 0fdffd4..77c5c9e 100644 --- a/github3/core.py +++ b/github3/core.py @@ -22,9 +22,14 @@ def no_auth(): return gh -def basic_auth(): +def basic_auth(username, password): """Returns an authenticated Github object, via HTTP Basic.""" + def enable_auth(*args, **kwargs): + kwargs['auth'] = (username, password) + return args, kwargs + gh = Github() + gh._requests_pre_hook = enable_auth return gh
\ No newline at end of file |