mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
create_repo -> create_repo
This commit is contained in:
@@ -122,12 +122,12 @@ class ListOfReferences:
|
||||
return obj._github._statusRequest( "GET", obj._baseUrl + "/" + self.__attributeName + "/" + toBeQueried._identity ) == 204
|
||||
|
||||
class ListOfObjects:
|
||||
def __init__( self, attributeName, type, creatable = False ):
|
||||
def __init__( self, attributeName, type, creatable = False, singularName = None ):
|
||||
self.__attributeName = attributeName
|
||||
self.__type = type
|
||||
self.__getName = "get_" + attributeName
|
||||
if creatable:
|
||||
self.__createName = "create_" + attributeName
|
||||
self.__createName = "create_" + ( singularName or attributeName )
|
||||
else:
|
||||
self.__createName = None
|
||||
|
||||
|
||||
@@ -77,9 +77,9 @@ Repository._addAttributePolicy( ComplexAttribute( "parent", Repository ) )
|
||||
Repository._addAttributePolicy( ComplexAttribute( "source", Repository ) )
|
||||
Repository._addAttributePolicy( ListOfReferences( "forks", Repository ) )
|
||||
|
||||
AuthenticatedUser._addAttributePolicy( ListOfObjects( "repos", Repository, creatable = True ) )
|
||||
AuthenticatedUser._addAttributePolicy( ListOfObjects( "repos", Repository, creatable = True, singularName = "repo" ) )
|
||||
NamedUser._addAttributePolicy( ListOfObjects( "repos", Repository ) )
|
||||
Organization._addAttributePolicy( ListOfObjects( "repos", Repository, creatable = True ) )
|
||||
Organization._addAttributePolicy( ListOfObjects( "repos", Repository, creatable = True, singularName = "repo" ) )
|
||||
|
||||
def __repoFromUser( user, name ):
|
||||
return Repository( user._github, { "name": name, "owner": { "login": user.login } }, lazy = False )
|
||||
|
||||
Reference in New Issue
Block a user