From 97d85351bb0c8a0d2e49db3e77c31541faa25eff Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sat, 23 Jul 2011 23:18:17 -0400 Subject: basic auth -- that was easy :) --- github3/core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'github3/core.py') 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 -- cgit v1.2.3-59-g8ed1b