mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 11:51:10 +00:00
Small clean-up + type fixes
This commit is contained in:
@@ -62,15 +62,15 @@ API `/legacy/issues/search/:owner/:repository/:state/:keyword`
|
||||
* GET: `Repository.search_issues`
|
||||
|
||||
API `/legacy/repos/search/:keyword`
|
||||
==============================================================
|
||||
===================================
|
||||
* GET: `Github.search_repos`
|
||||
|
||||
API `/legacy/user/search/:keyword`
|
||||
==============================================================
|
||||
==================================
|
||||
* GET: `Github.search_users`
|
||||
|
||||
API `/legacy/user/email/:email`
|
||||
==============================================================
|
||||
===============================
|
||||
* GET: `Github.search_user_by_email`
|
||||
|
||||
API `/networks/:user/:repo/events`
|
||||
|
||||
@@ -27,7 +27,7 @@ Methods
|
||||
* `get_user( login )`: `NamedUser`
|
||||
* `get_organization( login )`: `Organization`
|
||||
* `get_gist( id )`: `Gist`
|
||||
* `id`: integer
|
||||
* `id`: string
|
||||
* `get_gists()`: iterator of `Gist`
|
||||
* `search_repos( keyword )`: iterator of `Repository`
|
||||
* `legacy_search_repos( keyword, [language] )`: iterator of `Repository`
|
||||
|
||||
+6
-3
@@ -31,8 +31,9 @@ class Github( object ):
|
||||
def rate_limiting( self ):
|
||||
return self.__requester.rate_limiting
|
||||
|
||||
def get_user( self, login = None ):
|
||||
if login is None:
|
||||
def get_user( self, login = GithubObject.NotSet ):
|
||||
assert login is GithubObject.NotSet or isinstance( login, ( str, unicode ) ), login
|
||||
if login is GithubObject.NotSet:
|
||||
return AuthenticatedUser.AuthenticatedUser( self.__requester, { "url": "https://api.github.com/user" }, completed = False )
|
||||
else:
|
||||
headers, data = self.__requester.requestAndCheck(
|
||||
@@ -44,6 +45,7 @@ class Github( object ):
|
||||
return NamedUser.NamedUser( self.__requester, data, completed = True )
|
||||
|
||||
def get_organization( self, login ):
|
||||
assert isinstance( login, ( str, unicode ) ), login
|
||||
headers, data = self.__requester.requestAndCheck(
|
||||
"GET",
|
||||
"https://api.github.com/orgs/" + login,
|
||||
@@ -53,9 +55,10 @@ class Github( object ):
|
||||
return Organization.Organization( self.__requester, data, completed = True )
|
||||
|
||||
def get_gist( self, id ):
|
||||
assert isinstance( id, ( str, unicode ) ), id
|
||||
headers, data = self.__requester.requestAndCheck(
|
||||
"GET",
|
||||
"https://api.github.com/gists/" + str( id ),
|
||||
"https://api.github.com/gists/" + id,
|
||||
None,
|
||||
None
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user