Fix code generation and tests after reorganization

This commit is contained in:
Vincent Jacques
2012-05-10 18:26:18 +02:00
parent 595e88cd55
commit 283da5e7de
4 changed files with 23 additions and 18 deletions
+11 -11
View File
@@ -1,9 +1,9 @@
from Requester import Requester
import GithubObjects.AuthenticatedUser
import GithubObjects.NamedUser
import GithubObjects.Organization
import GithubObjects.Gist
import GithubObjects.PaginatedList
import AuthenticatedUser
import NamedUser
import Organization
import Gist
import PaginatedList
class Github:
def __init__( self, login, password ):
@@ -15,32 +15,32 @@ class Github:
"url": "https://api.github.com/user", # @todo Erf, this url is replaced by /users/login when __complete is called...
# "login": self.__login # @todo ?
}
return GithubObjects.AuthenticatedUser.AuthenticatedUser( self.__requester, attributes, lazy = True )
return AuthenticatedUser.AuthenticatedUser( self.__requester, attributes, lazy = True )
else:
attributes = {
"url": "https://api.github.com/users/" + login,
"login": login,
}
return GithubObjects.NamedUser.NamedUser( self.__requester, attributes, lazy = False )
return NamedUser.NamedUser( self.__requester, attributes, lazy = False )
def get_organization( self, login ):
attributes = {
"url": "https://api.github.com/orgs/" + login,
"login": login,
}
return GithubObjects.Organization.Organization( self.__requester, attributes, lazy = False )
return Organization.Organization( self.__requester, attributes, lazy = False )
def get_gist( self, id ):
attributes = {
"url": "https://api.github.com/gists/" + str( id ),
"id": id,
}
return GithubObjects.Gist.Gist( self.__requester, attributes, lazy = False )
return Gist.Gist( self.__requester, attributes, lazy = False )
def get_gists( self ):
status, headers, data = self.__requester.request( "GET", "https://api.github.com/gists/public", None, None )
return GithubObjects.PaginatedList.PaginatedList(
GithubObjects.Gist.Gist,
return PaginatedList.PaginatedList(
Gist.Gist,
self.__requester,
headers,
data