aboutsummaryrefslogtreecommitdiffstats
path: root/github3/core.py
diff options
context:
space:
mode:
authorKenneth Reitz <me@kennethreitz.com>2011-07-23 23:18:17 -0400
committerKenneth Reitz <me@kennethreitz.com>2011-07-23 23:18:17 -0400
commit97d85351bb0c8a0d2e49db3e77c31541faa25eff (patch)
treec00864eca543a342ffe98fa0047fb87ecc75ba2e /github3/core.py
parentget_me (diff)
downloadpython-github3-97d85351bb0c8a0d2e49db3e77c31541faa25eff.tar.xz
python-github3-97d85351bb0c8a0d2e49db3e77c31541faa25eff.zip
basic auth -- that was easy :)
Diffstat (limited to 'github3/core.py')
-rw-r--r--github3/core.py7
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