aboutsummaryrefslogtreecommitdiffstats
path: root/github3/core.py
diff options
context:
space:
mode:
authorKenneth Reitz <me@kennethreitz.com>2011-04-13 19:34:50 -0400
committerKenneth Reitz <me@kennethreitz.com>2011-04-13 19:34:50 -0400
commit9cf503801a4c812f6948e9d5c43f2ff6061f3ead (patch)
tree5e9e88556b6bca4844b71d00a1175b1b3e5e09f8 /github3/core.py
parentmove api (diff)
downloadpython-github3-9cf503801a4c812f6948e9d5c43f2ff6061f3ead.tar.xz
python-github3-9cf503801a4c812f6948e9d5c43f2ff6061f3ead.zip
hrm
Diffstat (limited to 'github3/core.py')
-rw-r--r--github3/core.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/github3/core.py b/github3/core.py
index 6d1ee21..e0703a5 100644
--- a/github3/core.py
+++ b/github3/core.py
@@ -22,7 +22,6 @@ class GitHub(object):
def __init__(self, apiurl=API_URL):
self.__basic_auth = None
- return self.logged_in()
def _get(self, *path):
r = get(*path, auth=self.__basic_auth)
@@ -38,13 +37,21 @@ class GitHub(object):
def auth(self, username, password):
self.__basic_auth = (username, password)
+ return self.logged_in
def oauth(self):
# TODO: oAuth
pass
+ @property
def logged_in(self):
- print self._get('').headers
+ r = self._get('')
+
+ # print r
+ if r.status_code == 200:
+ return True
+ else:
+ return False