11# -*- coding: utf-8 -*-
22
33"""
4- heroku .api
4+ github3 .api
55~~~~~~~~~~
66
7- This module provides the basic API interface for Heroku .
7+ This module provides the basic API interface for Github .
88"""
99
1010import json
1818
1919
2020class GithubCore (object ):
21- """The core Heroku class."""
21+ """The core Github class."""
2222 def __init__ (self ):
2323 super (GithubCore , self ).__init__ ()
2424
@@ -32,10 +32,10 @@ def __init__(self):
3232 self ._s .headers .update ({'Accept' : 'application/json' })
3333
3434 def __repr__ (self ):
35- return '<heroku -core at 0x%x>' % (id (self ))
35+ return '<github -core at 0x%x>' % (id (self ))
3636
3737 def login (self , username , password ):
38- """Logs user into Heroku with given api_key ."""
38+ """Logs user into Github with given credentials ."""
3939
4040 # Attach auth to session.
4141 self ._s .auth = (username .password )
@@ -51,7 +51,7 @@ def is_authenticated(self):
5151
5252 def _url_for (self , * args ):
5353 args = map (str , args )
54- return '/' .join ([self ._heroku_url ] + list (args ))
54+ return '/' .join ([self ._github_url ] + list (args ))
5555
5656 @staticmethod
5757 def _resource_serialize (o ):
@@ -76,7 +76,6 @@ def _http_resource(self, method, resource, params=None, data=None):
7676 url = self ._url_for (* resource )
7777 r = self ._s .request (method , url , params = params , data = data )
7878
79- # TODO: check heroku's status codes
8079 r .raise_for_status ()
8180
8281 return r
0 commit comments