mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
On the way to code generation instead of meta-description
(lots of useless eratic history squashed together in one commit)
This commit is contained in:
@@ -1,94 +1,442 @@
|
||||
from Authorization import *
|
||||
from UserKey import *
|
||||
from Event import *
|
||||
from NamedUser import *
|
||||
from Organization import *
|
||||
from Repository import *
|
||||
from Gist import *
|
||||
from Issue import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
def __getOrganizationEvents( user, org ):
|
||||
return [
|
||||
Event( user._github, attributes, lazy = True )
|
||||
for attributes
|
||||
in user._github._dataRequest( "GET", "/users/" + user.login + "/events/orgs/" + org.login, None, None )
|
||||
]
|
||||
|
||||
def __createFork( user, repo ):
|
||||
assert isinstance( repo, Repository )
|
||||
return Repository( user._github, user._github._dataRequest( "POST", repo._baseUrl() + "/forks", None, None ), lazy = True )
|
||||
class AuthenticatedUser( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
def __getStaredGists( user ):
|
||||
return [
|
||||
Gist( user._github, attributes, lazy = True )
|
||||
for attributes in user._github._dataRequest( "GET", "/gists/starred", None, None )
|
||||
]
|
||||
@property
|
||||
def avatar_url( self ):
|
||||
if self.__avatar_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__avatar_url
|
||||
|
||||
AuthenticatedUser = GithubObject(
|
||||
"AuthenticatedUser",
|
||||
BaseUrl( lambda obj: "/user" ),
|
||||
Identity( lambda obj: obj.login ),
|
||||
InternalSimpleAttributes(
|
||||
"login", "id", "avatar_url", "gravatar_id", "url", "name", "company",
|
||||
"blog", "location", "email", "hireable", "bio", "public_repos",
|
||||
"public_gists", "followers", "following", "html_url", "created_at",
|
||||
"type", "total_private_repos", "owned_private_repos", "private_gists",
|
||||
"disk_usage", "collaborators", "plan",
|
||||
),
|
||||
Editable( Parameters( [], [ "name", "email", "blog", "company", "location", "hireable", "bio" ] ) ),
|
||||
ExternalListOfSimpleTypes( "emails", "email", "string",
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
SeveralElementsAddable(),
|
||||
SeveralElementsRemovable()
|
||||
),
|
||||
ExternalListOfObjects( "authorizations", "authorization", Authorization,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementGetable( Parameters( [ "id" ], [] ) ),
|
||||
ElementCreatable( Parameters( [], [ "scopes", "note", "note_url" ] ) ),
|
||||
url = "/authorizations",
|
||||
),
|
||||
ExternalListOfObjects( "keys", "key", UserKey,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementGetable( Parameters( [ "id" ], [] ) ),
|
||||
ElementCreatable( Parameters( [ "title", "key" ], [] ) ),
|
||||
),
|
||||
ExternalListOfObjects( "events", "event", Event,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
url = "/events"
|
||||
),
|
||||
ExternalListOfObjects( "followers", "follower", NamedUser,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
),
|
||||
ExternalListOfObjects( "following", "following", NamedUser,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementAddable(),
|
||||
ElementRemovable(),
|
||||
ElementHasable()
|
||||
),
|
||||
ExternalListOfObjects( "orgs", "org", Organization,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
),
|
||||
MethodFromCallable( "get_organization_events", Parameters( [ "org" ], [] ), __getOrganizationEvents, SimpleTypePolicy( "list of `Event`" ) ),
|
||||
ExternalListOfObjects( "repos", "repo", Repository,
|
||||
ListGetable( Parameters( [], [ "type" ] ) ),
|
||||
ElementGetable( Parameters( [ "name" ], [] ), { "owner" : lambda user: { "login": user.login } } ),
|
||||
ElementCreatable( Parameters( [ "name" ], [ "description", "homepage", "private", "has_issues", "has_wiki", "has_downloads", "team_id", ] ) )
|
||||
),
|
||||
ExternalListOfObjects( "watched", "watched", Repository,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementAddable(),
|
||||
ElementRemovable(),
|
||||
ElementHasable()
|
||||
),
|
||||
SeveralAttributePolicies( [ MethodFromCallable( "create_fork", Parameters( [ "repo" ], [] ), __createFork, ObjectTypePolicy( Repository ) ) ], "Forking" ),
|
||||
ExternalListOfObjects( "gists", "gist", Gist,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementCreatable( Parameters( [ "public", "files", ], [ "description" ] ) ),
|
||||
url = "/gists",
|
||||
),
|
||||
MethodFromCallable( "get_starred_gists", Parameters( [], [] ), __getStaredGists, SimpleTypePolicy( "list of `Gist`" ) ),
|
||||
ExternalListOfObjects( "issues", "issue", Issue,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
url = "/issues",
|
||||
),
|
||||
)
|
||||
@property
|
||||
def bio( self ):
|
||||
if self.__bio is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__bio
|
||||
|
||||
@property
|
||||
def blog( self ):
|
||||
if self.__blog is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__blog
|
||||
|
||||
@property
|
||||
def collaborators( self ):
|
||||
if self.__collaborators is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__collaborators
|
||||
|
||||
@property
|
||||
def company( self ):
|
||||
if self.__company is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__company
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def disk_usage( self ):
|
||||
if self.__disk_usage is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__disk_usage
|
||||
|
||||
@property
|
||||
def email( self ):
|
||||
if self.__email is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__email
|
||||
|
||||
@property
|
||||
def followers( self ):
|
||||
if self.__followers is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__followers
|
||||
|
||||
@property
|
||||
def following( self ):
|
||||
if self.__following is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__following
|
||||
|
||||
@property
|
||||
def gravatar_id( self ):
|
||||
if self.__gravatar_id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__gravatar_id
|
||||
|
||||
@property
|
||||
def hireable( self ):
|
||||
if self.__hireable is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__hireable
|
||||
|
||||
@property
|
||||
def html_url( self ):
|
||||
if self.__html_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__html_url
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def location( self ):
|
||||
if self.__location is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__location
|
||||
|
||||
@property
|
||||
def login( self ):
|
||||
if self.__login is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__login
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
if self.__name is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__name
|
||||
|
||||
@property
|
||||
def owned_private_repos( self ):
|
||||
if self.__owned_private_repos is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__owned_private_repos
|
||||
|
||||
@property
|
||||
def plan( self ):
|
||||
if self.__plan is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__plan
|
||||
|
||||
@property
|
||||
def private_gists( self ):
|
||||
if self.__private_gists is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__private_gists
|
||||
|
||||
@property
|
||||
def public_gists( self ):
|
||||
if self.__public_gists is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__public_gists
|
||||
|
||||
@property
|
||||
def public_repos( self ):
|
||||
if self.__public_repos is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__public_repos
|
||||
|
||||
@property
|
||||
def total_private_repos( self ):
|
||||
if self.__total_private_repos is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__total_private_repos
|
||||
|
||||
@property
|
||||
def type( self ):
|
||||
if self.__type is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__type
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__avatar_url = None
|
||||
self.__bio = None
|
||||
self.__blog = None
|
||||
self.__collaborators = None
|
||||
self.__company = None
|
||||
self.__created_at = None
|
||||
self.__disk_usage = None
|
||||
self.__email = None
|
||||
self.__followers = None
|
||||
self.__following = None
|
||||
self.__gravatar_id = None
|
||||
self.__hireable = None
|
||||
self.__html_url = None
|
||||
self.__id = None
|
||||
self.__location = None
|
||||
self.__login = None
|
||||
self.__name = None
|
||||
self.__owned_private_repos = None
|
||||
self.__plan = None
|
||||
self.__private_gists = None
|
||||
self.__public_gists = None
|
||||
self.__public_repos = None
|
||||
self.__total_private_repos = None
|
||||
self.__type = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def add_to_emails( self, *emails ):
|
||||
pass
|
||||
|
||||
def add_to_following( self, following ):
|
||||
pass
|
||||
|
||||
def add_to_watched( self, watched ):
|
||||
pass
|
||||
|
||||
def create_authorization( self, scopes = None, note = None, note_url = None ):
|
||||
pass
|
||||
|
||||
def create_fork( self, repo ):
|
||||
result = self.__github._dataRequest(
|
||||
"POST",
|
||||
"/repos/" + repo.owner.login + "/" + repo.name + "/forks",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return Repository.Repository( self.__github, result, lazy = True )
|
||||
|
||||
def create_gist( self, public, files, description = None ):
|
||||
pass
|
||||
|
||||
def create_key( self, title, key ):
|
||||
pass
|
||||
|
||||
def create_repo( self, name, description = None, homepage = None, private = None, has_issues = None, has_wiki = None, has_downloads = None, team_id = None ):
|
||||
pass
|
||||
|
||||
def edit( self, name = None, email = None, blog = None, company = None, location = None, hireable = None, bio = None ):
|
||||
pass
|
||||
|
||||
def get_authorization( self, id ):
|
||||
pass
|
||||
|
||||
def get_authorizations( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/authorizations",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Authorization.Authorization( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_emails( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/emails",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
string.string( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_events( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/events",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Event.Event( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_followers( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/followers",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
NamedUser.NamedUser( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_following( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/following",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
NamedUser.NamedUser( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_gists( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/gists",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Gist.Gist( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_issues( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/issues",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Issue.Issue( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_key( self, id ):
|
||||
pass
|
||||
|
||||
def get_keys( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/keys",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
UserKey.UserKey( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_organization_events( self, org ):
|
||||
pass
|
||||
|
||||
def get_orgs( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/orgs",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Organization.Organization( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_repo( self, name ):
|
||||
pass
|
||||
|
||||
def get_repos( self, type = None ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/repos",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Repository.Repository( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_starred_gists( self ):
|
||||
pass
|
||||
|
||||
def get_watched( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/watched",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Repository.Repository( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def has_in_following( self, following ):
|
||||
pass
|
||||
|
||||
def has_in_watched( self, watched ):
|
||||
pass
|
||||
|
||||
def remove_from_emails( self, *emails ):
|
||||
pass
|
||||
|
||||
def remove_from_following( self, following ):
|
||||
pass
|
||||
|
||||
def remove_from_watched( self, watched ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "avatar_url" in attributes:
|
||||
self.__avatar_url = attributes[ "avatar_url" ]
|
||||
if "bio" in attributes:
|
||||
self.__bio = attributes[ "bio" ]
|
||||
if "blog" in attributes:
|
||||
self.__blog = attributes[ "blog" ]
|
||||
if "collaborators" in attributes:
|
||||
self.__collaborators = attributes[ "collaborators" ]
|
||||
if "company" in attributes:
|
||||
self.__company = attributes[ "company" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "disk_usage" in attributes:
|
||||
self.__disk_usage = attributes[ "disk_usage" ]
|
||||
if "email" in attributes:
|
||||
self.__email = attributes[ "email" ]
|
||||
if "followers" in attributes:
|
||||
self.__followers = attributes[ "followers" ]
|
||||
if "following" in attributes:
|
||||
self.__following = attributes[ "following" ]
|
||||
if "gravatar_id" in attributes:
|
||||
self.__gravatar_id = attributes[ "gravatar_id" ]
|
||||
if "hireable" in attributes:
|
||||
self.__hireable = attributes[ "hireable" ]
|
||||
if "html_url" in attributes:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "location" in attributes:
|
||||
self.__location = attributes[ "location" ]
|
||||
if "login" in attributes:
|
||||
self.__login = attributes[ "login" ]
|
||||
if "name" in attributes:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "owned_private_repos" in attributes:
|
||||
self.__owned_private_repos = attributes[ "owned_private_repos" ]
|
||||
if "plan" in attributes:
|
||||
self.__plan = attributes[ "plan" ]
|
||||
if "private_gists" in attributes:
|
||||
self.__private_gists = attributes[ "private_gists" ]
|
||||
if "public_gists" in attributes:
|
||||
self.__public_gists = attributes[ "public_gists" ]
|
||||
if "public_repos" in attributes:
|
||||
self.__public_repos = attributes[ "public_repos" ]
|
||||
if "total_private_repos" in attributes:
|
||||
self.__total_private_repos = attributes[ "total_private_repos" ]
|
||||
if "type" in attributes:
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,12 +1,109 @@
|
||||
from GithubObject import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
Authorization = GithubObject(
|
||||
"Authorization",
|
||||
BaseUrl( lambda obj: "/authorizations/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"id", "url", "scopes", "token", "app", "note", "note_url", "updated_at",
|
||||
"created_at",
|
||||
),
|
||||
Editable( Parameters( [], [ "scopes", "add_scopes", "remove_scopes", "note", "note_url" ] ) ),
|
||||
Deletable(),
|
||||
)
|
||||
|
||||
class Authorization( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def app( self ):
|
||||
if self.__app is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__app
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def note( self ):
|
||||
if self.__note is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__note
|
||||
|
||||
@property
|
||||
def note_url( self ):
|
||||
if self.__note_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__note_url
|
||||
|
||||
@property
|
||||
def scopes( self ):
|
||||
if self.__scopes is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__scopes
|
||||
|
||||
@property
|
||||
def token( self ):
|
||||
if self.__token is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__token
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
if self.__updated_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__app = None
|
||||
self.__created_at = None
|
||||
self.__id = None
|
||||
self.__note = None
|
||||
self.__note_url = None
|
||||
self.__scopes = None
|
||||
self.__token = None
|
||||
self.__updated_at = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, scopes = None, add_scopes = None, remove_scopes = None, note = None, note_url = None ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "app" in attributes:
|
||||
self.__app = attributes[ "app" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "note" in attributes:
|
||||
self.__note = attributes[ "note" ]
|
||||
if "note_url" in attributes:
|
||||
self.__note_url = attributes[ "note_url" ]
|
||||
if "scopes" in attributes:
|
||||
self.__scopes = attributes[ "scopes" ]
|
||||
if "token" in attributes:
|
||||
self.__token = attributes[ "token" ]
|
||||
if "updated_at" in attributes:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,10 +1,40 @@
|
||||
from Commit import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
Branch = GithubObject(
|
||||
"Branch",
|
||||
InternalSimpleAttributes(
|
||||
"name",
|
||||
"_repo",
|
||||
),
|
||||
InternalObjectAttribute( "commit", Commit )
|
||||
)
|
||||
|
||||
class Branch( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def commit( self ):
|
||||
if self.__commit is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__commit
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
if self.__name is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__name
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__commit = None
|
||||
self.__name = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "commit" in attributes:
|
||||
self.__commit = attributes[ "commit" ]
|
||||
if "name" in attributes:
|
||||
self.__name = attributes[ "name" ]
|
||||
|
||||
+107
-22
@@ -1,24 +1,109 @@
|
||||
from GitCommit import *
|
||||
from NamedUser import *
|
||||
from CommitComment import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
__modifyAttributesForObjectsReferingReferedRepo = { "_repo": lambda obj: obj._repo }
|
||||
|
||||
Commit = GithubObject(
|
||||
"Commit",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/commits/" + str( obj.sha ) ),
|
||||
InternalSimpleAttributes(
|
||||
"sha", "url",
|
||||
"parents",
|
||||
"stats",
|
||||
"files",
|
||||
"_repo",
|
||||
),
|
||||
InternalObjectAttribute( "commit", GitCommit ),
|
||||
InternalObjectAttribute( "author", NamedUser ),
|
||||
InternalObjectAttribute( "committer", NamedUser ),
|
||||
ExternalListOfObjects( "comments", "comment", CommitComment,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ),
|
||||
ElementCreatable( Parameters( [ "body" ], [ "commit_id", "line", "path", "position" ] ), __modifyAttributesForObjectsReferingReferedRepo ),
|
||||
),
|
||||
)
|
||||
class Commit( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def author( self ):
|
||||
if self.__author is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__author
|
||||
|
||||
@property
|
||||
def commit( self ):
|
||||
if self.__commit is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__commit
|
||||
|
||||
@property
|
||||
def committer( self ):
|
||||
if self.__committer is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__committer
|
||||
|
||||
@property
|
||||
def files( self ):
|
||||
if self.__files is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__files
|
||||
|
||||
@property
|
||||
def parents( self ):
|
||||
if self.__parents is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__parents
|
||||
|
||||
@property
|
||||
def sha( self ):
|
||||
if self.__sha is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__sha
|
||||
|
||||
@property
|
||||
def stats( self ):
|
||||
if self.__stats is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__stats
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__author = None
|
||||
self.__commit = None
|
||||
self.__committer = None
|
||||
self.__files = None
|
||||
self.__parents = None
|
||||
self.__sha = None
|
||||
self.__stats = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def create_comment( self, body, commit_id = None, line = None, path = None, position = None ):
|
||||
pass
|
||||
|
||||
def get_comments( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/comments",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
CommitComment.CommitComment( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "author" in attributes:
|
||||
self.__author = attributes[ "author" ]
|
||||
if "commit" in attributes:
|
||||
self.__commit = attributes[ "commit" ]
|
||||
if "committer" in attributes:
|
||||
self.__committer = attributes[ "committer" ]
|
||||
if "files" in attributes:
|
||||
self.__files = attributes[ "files" ]
|
||||
if "parents" in attributes:
|
||||
self.__parents = attributes[ "parents" ]
|
||||
if "sha" in attributes:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "stats" in attributes:
|
||||
self.__stats = attributes[ "stats" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,14 +1,127 @@
|
||||
from NamedUser import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
CommitComment = GithubObject(
|
||||
"CommitComment",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/comments/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "id", "body", "path", "position", "commit_id",
|
||||
"created_at", "updated_at", "html_url", "line",
|
||||
"_repo",
|
||||
),
|
||||
InternalObjectAttribute( "user", NamedUser ),
|
||||
Editable( Parameters( [ "body" ], [] ) ),
|
||||
Deletable(),
|
||||
)
|
||||
|
||||
class CommitComment( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def body( self ):
|
||||
if self.__body is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__body
|
||||
|
||||
@property
|
||||
def commit_id( self ):
|
||||
if self.__commit_id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__commit_id
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def html_url( self ):
|
||||
if self.__html_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__html_url
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def line( self ):
|
||||
if self.__line is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__line
|
||||
|
||||
@property
|
||||
def path( self ):
|
||||
if self.__path is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__path
|
||||
|
||||
@property
|
||||
def position( self ):
|
||||
if self.__position is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__position
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
if self.__updated_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
if self.__user is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__user
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__body = None
|
||||
self.__commit_id = None
|
||||
self.__created_at = None
|
||||
self.__html_url = None
|
||||
self.__id = None
|
||||
self.__line = None
|
||||
self.__path = None
|
||||
self.__position = None
|
||||
self.__updated_at = None
|
||||
self.__url = None
|
||||
self.__user = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, body ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "body" in attributes:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "commit_id" in attributes:
|
||||
self.__commit_id = attributes[ "commit_id" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "html_url" in attributes:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "line" in attributes:
|
||||
self.__line = attributes[ "line" ]
|
||||
if "path" in attributes:
|
||||
self.__path = attributes[ "path" ]
|
||||
if "position" in attributes:
|
||||
self.__position = attributes[ "position" ]
|
||||
if "updated_at" in attributes:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
self.__user = attributes[ "user" ]
|
||||
|
||||
@@ -1,14 +1,205 @@
|
||||
from GithubObject import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
Download = GithubObject(
|
||||
"Download",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/downloads/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "html_url", "id", "name", "description", "size",
|
||||
"download_count", "content_type", "policy", "signature", "bucket",
|
||||
"accesskeyid", "path", "acl", "expirationdate", "prefix", "mime_type",
|
||||
"redirect", "s3_url", "created_at",
|
||||
"_repo",
|
||||
),
|
||||
Deletable(),
|
||||
)
|
||||
|
||||
class Download( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def accesskeyid( self ):
|
||||
if self.__accesskeyid is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__accesskeyid
|
||||
|
||||
@property
|
||||
def acl( self ):
|
||||
if self.__acl is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__acl
|
||||
|
||||
@property
|
||||
def bucket( self ):
|
||||
if self.__bucket is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__bucket
|
||||
|
||||
@property
|
||||
def content_type( self ):
|
||||
if self.__content_type is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__content_type
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def description( self ):
|
||||
if self.__description is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__description
|
||||
|
||||
@property
|
||||
def download_count( self ):
|
||||
if self.__download_count is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__download_count
|
||||
|
||||
@property
|
||||
def expirationdate( self ):
|
||||
if self.__expirationdate is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__expirationdate
|
||||
|
||||
@property
|
||||
def html_url( self ):
|
||||
if self.__html_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__html_url
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def mime_type( self ):
|
||||
if self.__mime_type is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__mime_type
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
if self.__name is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__name
|
||||
|
||||
@property
|
||||
def path( self ):
|
||||
if self.__path is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__path
|
||||
|
||||
@property
|
||||
def policy( self ):
|
||||
if self.__policy is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__policy
|
||||
|
||||
@property
|
||||
def prefix( self ):
|
||||
if self.__prefix is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__prefix
|
||||
|
||||
@property
|
||||
def redirect( self ):
|
||||
if self.__redirect is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__redirect
|
||||
|
||||
@property
|
||||
def s3_url( self ):
|
||||
if self.__s3_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__s3_url
|
||||
|
||||
@property
|
||||
def signature( self ):
|
||||
if self.__signature is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__signature
|
||||
|
||||
@property
|
||||
def size( self ):
|
||||
if self.__size is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__size
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__accesskeyid = None
|
||||
self.__acl = None
|
||||
self.__bucket = None
|
||||
self.__content_type = None
|
||||
self.__created_at = None
|
||||
self.__description = None
|
||||
self.__download_count = None
|
||||
self.__expirationdate = None
|
||||
self.__html_url = None
|
||||
self.__id = None
|
||||
self.__mime_type = None
|
||||
self.__name = None
|
||||
self.__path = None
|
||||
self.__policy = None
|
||||
self.__prefix = None
|
||||
self.__redirect = None
|
||||
self.__s3_url = None
|
||||
self.__signature = None
|
||||
self.__size = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "accesskeyid" in attributes:
|
||||
self.__accesskeyid = attributes[ "accesskeyid" ]
|
||||
if "acl" in attributes:
|
||||
self.__acl = attributes[ "acl" ]
|
||||
if "bucket" in attributes:
|
||||
self.__bucket = attributes[ "bucket" ]
|
||||
if "content_type" in attributes:
|
||||
self.__content_type = attributes[ "content_type" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "description" in attributes:
|
||||
self.__description = attributes[ "description" ]
|
||||
if "download_count" in attributes:
|
||||
self.__download_count = attributes[ "download_count" ]
|
||||
if "expirationdate" in attributes:
|
||||
self.__expirationdate = attributes[ "expirationdate" ]
|
||||
if "html_url" in attributes:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "mime_type" in attributes:
|
||||
self.__mime_type = attributes[ "mime_type" ]
|
||||
if "name" in attributes:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "path" in attributes:
|
||||
self.__path = attributes[ "path" ]
|
||||
if "policy" in attributes:
|
||||
self.__policy = attributes[ "policy" ]
|
||||
if "prefix" in attributes:
|
||||
self.__prefix = attributes[ "prefix" ]
|
||||
if "redirect" in attributes:
|
||||
self.__redirect = attributes[ "redirect" ]
|
||||
if "s3_url" in attributes:
|
||||
self.__s3_url = attributes[ "s3_url" ]
|
||||
if "signature" in attributes:
|
||||
self.__signature = attributes[ "signature" ]
|
||||
if "size" in attributes:
|
||||
self.__size = attributes[ "size" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
+129
-13
@@ -1,14 +1,130 @@
|
||||
from Repository import *
|
||||
from NamedUser import *
|
||||
from Organization import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
Event = GithubObject(
|
||||
"Event",
|
||||
InternalSimpleAttributes(
|
||||
"type", "public", "payload", "created_at", "id", "commit_id", "url",
|
||||
"event", "issue",
|
||||
),
|
||||
InternalObjectAttribute( "repo", Repository ),
|
||||
InternalObjectAttribute( "actor", NamedUser ),
|
||||
InternalObjectAttribute( "org", Organization ),
|
||||
)
|
||||
|
||||
class Event( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def actor( self ):
|
||||
if self.__actor is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__actor
|
||||
|
||||
@property
|
||||
def commit_id( self ):
|
||||
if self.__commit_id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__commit_id
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def event( self ):
|
||||
if self.__event is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__event
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def issue( self ):
|
||||
if self.__issue is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__issue
|
||||
|
||||
@property
|
||||
def org( self ):
|
||||
if self.__org is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__org
|
||||
|
||||
@property
|
||||
def payload( self ):
|
||||
if self.__payload is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__payload
|
||||
|
||||
@property
|
||||
def public( self ):
|
||||
if self.__public is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__public
|
||||
|
||||
@property
|
||||
def repo( self ):
|
||||
if self.__repo is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__repo
|
||||
|
||||
@property
|
||||
def type( self ):
|
||||
if self.__type is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__type
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__actor = None
|
||||
self.__commit_id = None
|
||||
self.__created_at = None
|
||||
self.__event = None
|
||||
self.__id = None
|
||||
self.__issue = None
|
||||
self.__org = None
|
||||
self.__payload = None
|
||||
self.__public = None
|
||||
self.__repo = None
|
||||
self.__type = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "actor" in attributes:
|
||||
self.__actor = attributes[ "actor" ]
|
||||
if "commit_id" in attributes:
|
||||
self.__commit_id = attributes[ "commit_id" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "event" in attributes:
|
||||
self.__event = attributes[ "event" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "issue" in attributes:
|
||||
self.__issue = attributes[ "issue" ]
|
||||
if "org" in attributes:
|
||||
self.__org = attributes[ "org" ]
|
||||
if "payload" in attributes:
|
||||
self.__payload = attributes[ "payload" ]
|
||||
if "public" in attributes:
|
||||
self.__public = attributes[ "public" ]
|
||||
if "repo" in attributes:
|
||||
self.__repo = attributes[ "repo" ]
|
||||
if "type" in attributes:
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
+183
-36
@@ -1,37 +1,184 @@
|
||||
from NamedUser import *
|
||||
from GistComment import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
def __isStarred( gist ):
|
||||
return gist._github._statusRequest( "GET", gist._baseUrl() + "/star", None, None ) == 204
|
||||
def __setStarred( gist ):
|
||||
gist._github._statusRequest( "PUT", gist._baseUrl() + "/star", None, None )
|
||||
def __resetStarred( gist ):
|
||||
gist._github._statusRequest( "DELETE", gist._baseUrl() + "/star", None, None )
|
||||
Gist = GithubObject(
|
||||
"Gist",
|
||||
BaseUrl( lambda obj: "/gists/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "id", "description", "public", "files", "comments", "html_url",
|
||||
"git_pull_url", "git_push_url", "created_at", "forks", "history",
|
||||
"updated_at",
|
||||
),
|
||||
InternalObjectAttribute( "user", NamedUser ),
|
||||
Editable( Parameters( [], [ "description", "files" ] ) ),
|
||||
Deletable(),
|
||||
ExternalListOfObjects( "comments", "comment", GistComment,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementGetable( Parameters( [ "id" ], [] ) ),
|
||||
ElementCreatable( Parameters( [ "body" ], [] ) ),
|
||||
),
|
||||
SeveralAttributePolicies( [
|
||||
MethodFromCallable( "is_starred", Parameters( [], [] ), __isStarred, SimpleTypePolicy( "bool" ) ),
|
||||
MethodFromCallable( "set_starred", Parameters( [], [] ), __setStarred, SimpleTypePolicy( None ) ),
|
||||
MethodFromCallable( "reset_starred", Parameters( [], [] ), __resetStarred, SimpleTypePolicy( None ) ),
|
||||
], "Starring" ),
|
||||
)
|
||||
def __createFork( gist ):
|
||||
return Gist( gist._github, gist._github._dataRequest( "POST", gist._baseUrl() + "/fork", None, None ), lazy = True )
|
||||
Gist._addAttributePolicy( SeveralAttributePolicies( [
|
||||
MethodFromCallable( "create_fork", Parameters( [], [] ), __createFork, ObjectTypePolicy( Gist ) ),
|
||||
], "Forking" ),
|
||||
)
|
||||
|
||||
class Gist( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def comments( self ):
|
||||
if self.__comments is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__comments
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def description( self ):
|
||||
if self.__description is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__description
|
||||
|
||||
@property
|
||||
def files( self ):
|
||||
if self.__files is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__files
|
||||
|
||||
@property
|
||||
def forks( self ):
|
||||
if self.__forks is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__forks
|
||||
|
||||
@property
|
||||
def git_pull_url( self ):
|
||||
if self.__git_pull_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__git_pull_url
|
||||
|
||||
@property
|
||||
def git_push_url( self ):
|
||||
if self.__git_push_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__git_push_url
|
||||
|
||||
@property
|
||||
def history( self ):
|
||||
if self.__history is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__history
|
||||
|
||||
@property
|
||||
def html_url( self ):
|
||||
if self.__html_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__html_url
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def public( self ):
|
||||
if self.__public is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__public
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
if self.__updated_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
if self.__user is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__user
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__comments = None
|
||||
self.__created_at = None
|
||||
self.__description = None
|
||||
self.__files = None
|
||||
self.__forks = None
|
||||
self.__git_pull_url = None
|
||||
self.__git_push_url = None
|
||||
self.__history = None
|
||||
self.__html_url = None
|
||||
self.__id = None
|
||||
self.__public = None
|
||||
self.__updated_at = None
|
||||
self.__url = None
|
||||
self.__user = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def create_comment( self, body ):
|
||||
pass
|
||||
|
||||
def create_fork( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, description = None, files = None ):
|
||||
pass
|
||||
|
||||
def get_comment( self, id ):
|
||||
pass
|
||||
|
||||
def get_comments( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/comments",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
GistComment.GistComment( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def is_starred( self ):
|
||||
pass
|
||||
|
||||
def reset_starred( self ):
|
||||
pass
|
||||
|
||||
def set_starred( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "comments" in attributes:
|
||||
self.__comments = attributes[ "comments" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "description" in attributes:
|
||||
self.__description = attributes[ "description" ]
|
||||
if "files" in attributes:
|
||||
self.__files = attributes[ "files" ]
|
||||
if "forks" in attributes:
|
||||
self.__forks = attributes[ "forks" ]
|
||||
if "git_pull_url" in attributes:
|
||||
self.__git_pull_url = attributes[ "git_pull_url" ]
|
||||
if "git_push_url" in attributes:
|
||||
self.__git_push_url = attributes[ "git_push_url" ]
|
||||
if "history" in attributes:
|
||||
self.__history = attributes[ "history" ]
|
||||
if "html_url" in attributes:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "public" in attributes:
|
||||
self.__public = attributes[ "public" ]
|
||||
if "updated_at" in attributes:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
self.__user = attributes[ "user" ]
|
||||
|
||||
@@ -1,13 +1,82 @@
|
||||
from NamedUser import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
GistComment = GithubObject(
|
||||
"GistComment",
|
||||
BaseUrl( lambda obj: "/gists/comments/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"id", "url", "body", "created_at",
|
||||
"updated_at",
|
||||
),
|
||||
InternalObjectAttribute( "user", NamedUser ),
|
||||
Editable( Parameters( [ "body" ], [] ) ),
|
||||
Deletable(),
|
||||
)
|
||||
|
||||
class GistComment( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def body( self ):
|
||||
if self.__body is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__body
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
if self.__updated_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
if self.__user is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__user
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__body = None
|
||||
self.__created_at = None
|
||||
self.__id = None
|
||||
self.__updated_at = None
|
||||
self.__url = None
|
||||
self.__user = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, body ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "body" in attributes:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "updated_at" in attributes:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
self.__user = attributes[ "user" ]
|
||||
|
||||
@@ -1,11 +1,67 @@
|
||||
from GithubObject import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
GitBlob = GithubObject(
|
||||
"GitBlob",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/blobs/" + obj.sha ),
|
||||
InternalSimpleAttributes(
|
||||
"sha", "size", "url",
|
||||
"content", "encoding",
|
||||
"_repo",
|
||||
),
|
||||
)
|
||||
|
||||
class GitBlob( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def content( self ):
|
||||
if self.__content is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__content
|
||||
|
||||
@property
|
||||
def encoding( self ):
|
||||
if self.__encoding is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__encoding
|
||||
|
||||
@property
|
||||
def sha( self ):
|
||||
if self.__sha is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__sha
|
||||
|
||||
@property
|
||||
def size( self ):
|
||||
if self.__size is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__size
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__content = None
|
||||
self.__encoding = None
|
||||
self.__sha = None
|
||||
self.__size = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "content" in attributes:
|
||||
self.__content = attributes[ "content" ]
|
||||
if "encoding" in attributes:
|
||||
self.__encoding = attributes[ "encoding" ]
|
||||
if "sha" in attributes:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "size" in attributes:
|
||||
self.__size = attributes[ "size" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,13 +1,85 @@
|
||||
from GitTree import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
GitCommit = GithubObject(
|
||||
"GitCommit",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/commits/" + obj.sha ),
|
||||
InternalSimpleAttributes(
|
||||
"sha", "url", "message",
|
||||
"parents",
|
||||
"author", "committer",
|
||||
"_repo",
|
||||
),
|
||||
InternalObjectAttribute( "tree", GitTree ),
|
||||
)
|
||||
|
||||
class GitCommit( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def author( self ):
|
||||
if self.__author is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__author
|
||||
|
||||
@property
|
||||
def committer( self ):
|
||||
if self.__committer is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__committer
|
||||
|
||||
@property
|
||||
def message( self ):
|
||||
if self.__message is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__message
|
||||
|
||||
@property
|
||||
def parents( self ):
|
||||
if self.__parents is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__parents
|
||||
|
||||
@property
|
||||
def sha( self ):
|
||||
if self.__sha is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__sha
|
||||
|
||||
@property
|
||||
def tree( self ):
|
||||
if self.__tree is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__tree
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__author = None
|
||||
self.__committer = None
|
||||
self.__message = None
|
||||
self.__parents = None
|
||||
self.__sha = None
|
||||
self.__tree = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "author" in attributes:
|
||||
self.__author = attributes[ "author" ]
|
||||
if "committer" in attributes:
|
||||
self.__committer = attributes[ "committer" ]
|
||||
if "message" in attributes:
|
||||
self.__message = attributes[ "message" ]
|
||||
if "parents" in attributes:
|
||||
self.__parents = attributes[ "parents" ]
|
||||
if "sha" in attributes:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "tree" in attributes:
|
||||
self.__tree = attributes[ "tree" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,13 +1,55 @@
|
||||
from GithubObject import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
GitRef = GithubObject(
|
||||
"GitRef",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/" + obj.ref ),
|
||||
InternalSimpleAttributes(
|
||||
"ref", "url",
|
||||
"object",
|
||||
"_repo",
|
||||
),
|
||||
Editable( Parameters( [ "sha" ], [ "force" ] ) ),
|
||||
Deletable(),
|
||||
)
|
||||
|
||||
class GitRef( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def object( self ):
|
||||
if self.__object is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__object
|
||||
|
||||
@property
|
||||
def ref( self ):
|
||||
if self.__ref is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__ref
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__object = None
|
||||
self.__ref = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, sha, force = None ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "object" in attributes:
|
||||
self.__object = attributes[ "object" ]
|
||||
if "ref" in attributes:
|
||||
self.__ref = attributes[ "ref" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,13 +1,76 @@
|
||||
from GithubObject import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
GitTag = GithubObject(
|
||||
"GitTag",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/tags/" + obj.sha ),
|
||||
InternalSimpleAttributes(
|
||||
"tag", "sha", "url",
|
||||
"message",
|
||||
"tagger",
|
||||
"object",
|
||||
"_repo",
|
||||
),
|
||||
)
|
||||
|
||||
class GitTag( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def message( self ):
|
||||
if self.__message is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__message
|
||||
|
||||
@property
|
||||
def object( self ):
|
||||
if self.__object is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__object
|
||||
|
||||
@property
|
||||
def sha( self ):
|
||||
if self.__sha is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__sha
|
||||
|
||||
@property
|
||||
def tag( self ):
|
||||
if self.__tag is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__tag
|
||||
|
||||
@property
|
||||
def tagger( self ):
|
||||
if self.__tagger is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__tagger
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__message = None
|
||||
self.__object = None
|
||||
self.__sha = None
|
||||
self.__tag = None
|
||||
self.__tagger = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "message" in attributes:
|
||||
self.__message = attributes[ "message" ]
|
||||
if "object" in attributes:
|
||||
self.__object = attributes[ "object" ]
|
||||
if "sha" in attributes:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "tag" in attributes:
|
||||
self.__tag = attributes[ "tag" ]
|
||||
if "tagger" in attributes:
|
||||
self.__tagger = attributes[ "tagger" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,11 +1,58 @@
|
||||
from GithubObject import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
GitTree = GithubObject(
|
||||
"GitTree",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/trees/" + obj.sha + ( "?recursive=1" if obj.recursive else "" ) ),
|
||||
InternalSimpleAttributes(
|
||||
"sha", "url",
|
||||
"tree",
|
||||
"_repo", "recursive",
|
||||
),
|
||||
)
|
||||
|
||||
class GitTree( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def recursive( self ):
|
||||
if self.__recursive is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__recursive
|
||||
|
||||
@property
|
||||
def sha( self ):
|
||||
if self.__sha is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__sha
|
||||
|
||||
@property
|
||||
def tree( self ):
|
||||
if self.__tree is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__tree
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__recursive = None
|
||||
self.__sha = None
|
||||
self.__tree = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "recursive" in attributes:
|
||||
self.__recursive = attributes[ "recursive" ]
|
||||
if "sha" in attributes:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "tree" in attributes:
|
||||
self.__tree = attributes[ "tree" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -114,5 +114,5 @@ class SeveralAttributePolicies:
|
||||
doc += "\n"
|
||||
doc += self.__documentationSection + "\n"
|
||||
doc += "-" * len( self.__documentationSection ) + "\n"
|
||||
doc += "".join( attributePolicy.autoDocument() for attributePolicy in self.__attributePolicies )
|
||||
doc += "".join( sorted( attributePolicy.autoDocument() for attributePolicy in self.__attributePolicies ) )
|
||||
return doc
|
||||
|
||||
+111
-15
@@ -1,16 +1,112 @@
|
||||
from GithubObject import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
def __testHook( hook ):
|
||||
hook._github._statusRequest( "POST", hook._baseUrl() + "/test", None, None )
|
||||
Hook = GithubObject(
|
||||
"Hook",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/hooks/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "updated_at", "created_at", "name", "events", "active", "config",
|
||||
"id", "last_response",
|
||||
"_repo",
|
||||
),
|
||||
Editable( Parameters( [ "name", "config" ], [ "events", "add_events", "remove_events", "active" ] ) ),
|
||||
Deletable(),
|
||||
SeveralAttributePolicies( [ MethodFromCallable( "test", Parameters( [], [] ), __testHook, SimpleTypePolicy( None ) ) ], "Testing" )
|
||||
)
|
||||
|
||||
class Hook( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def active( self ):
|
||||
if self.__active is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__active
|
||||
|
||||
@property
|
||||
def config( self ):
|
||||
if self.__config is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__config
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def events( self ):
|
||||
if self.__events is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__events
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def last_response( self ):
|
||||
if self.__last_response is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__last_response
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
if self.__name is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__name
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
if self.__updated_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__active = None
|
||||
self.__config = None
|
||||
self.__created_at = None
|
||||
self.__events = None
|
||||
self.__id = None
|
||||
self.__last_response = None
|
||||
self.__name = None
|
||||
self.__updated_at = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, name, config, events = None, add_events = None, remove_events = None, active = None ):
|
||||
pass
|
||||
|
||||
def test( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "active" in attributes:
|
||||
self.__active = attributes[ "active" ]
|
||||
if "config" in attributes:
|
||||
self.__config = attributes[ "config" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "events" in attributes:
|
||||
self.__events = attributes[ "events" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "last_response" in attributes:
|
||||
self.__last_response = attributes[ "last_response" ]
|
||||
if "name" in attributes:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "updated_at" in attributes:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
+230
-35
@@ -1,37 +1,232 @@
|
||||
from NamedUser import *
|
||||
from Milestone import *
|
||||
from Label import *
|
||||
from IssueComment import *
|
||||
from IssueEvent import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
__modifyAttributesForObjectsReferingReferedRepo = { "_repo": lambda obj: obj._repo }
|
||||
|
||||
Issue = GithubObject(
|
||||
"Issue",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/issues/" + str( obj.number ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "html_url", "number", "state", "title", "body", "labels",
|
||||
"comments", "closed_at", "created_at", "updated_at", "id", "closed_by",
|
||||
"pull_request",
|
||||
"_repo",
|
||||
),
|
||||
InternalObjectAttribute( "user", NamedUser ),
|
||||
InternalObjectAttribute( "assignee", NamedUser ),
|
||||
InternalObjectAttribute( "milestone", Milestone ),
|
||||
Editable( Parameters( [], [ "title", "body", "assignee", "state", "milestone", "labels" ] ) ),
|
||||
ExternalListOfObjects( "labels", "label", Label,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ),
|
||||
SeveralElementsAddable(),
|
||||
ListSetable(),
|
||||
ListDeletable(),
|
||||
ElementRemovable(),
|
||||
),
|
||||
ExternalListOfObjects( "comments", "comment", IssueComment,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ),
|
||||
ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingReferedRepo ),
|
||||
ElementCreatable( Parameters( [ "body" ], [] ), __modifyAttributesForObjectsReferingReferedRepo ),
|
||||
),
|
||||
ExternalListOfObjects( "events", "event", IssueEvent,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo )
|
||||
),
|
||||
)
|
||||
class Issue( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def assignee( self ):
|
||||
if self.__assignee is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__assignee
|
||||
|
||||
@property
|
||||
def body( self ):
|
||||
if self.__body is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__body
|
||||
|
||||
@property
|
||||
def closed_at( self ):
|
||||
if self.__closed_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__closed_at
|
||||
|
||||
@property
|
||||
def closed_by( self ):
|
||||
if self.__closed_by is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__closed_by
|
||||
|
||||
@property
|
||||
def comments( self ):
|
||||
if self.__comments is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__comments
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def html_url( self ):
|
||||
if self.__html_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__html_url
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def labels( self ):
|
||||
if self.__labels is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__labels
|
||||
|
||||
@property
|
||||
def milestone( self ):
|
||||
if self.__milestone is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__milestone
|
||||
|
||||
@property
|
||||
def number( self ):
|
||||
if self.__number is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__number
|
||||
|
||||
@property
|
||||
def pull_request( self ):
|
||||
if self.__pull_request is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__pull_request
|
||||
|
||||
@property
|
||||
def state( self ):
|
||||
if self.__state is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__state
|
||||
|
||||
@property
|
||||
def title( self ):
|
||||
if self.__title is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__title
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
if self.__updated_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
if self.__user is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__user
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__assignee = None
|
||||
self.__body = None
|
||||
self.__closed_at = None
|
||||
self.__closed_by = None
|
||||
self.__comments = None
|
||||
self.__created_at = None
|
||||
self.__html_url = None
|
||||
self.__id = None
|
||||
self.__labels = None
|
||||
self.__milestone = None
|
||||
self.__number = None
|
||||
self.__pull_request = None
|
||||
self.__state = None
|
||||
self.__title = None
|
||||
self.__updated_at = None
|
||||
self.__url = None
|
||||
self.__user = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def add_to_labels( self, *labels ):
|
||||
pass
|
||||
|
||||
def create_comment( self, body ):
|
||||
pass
|
||||
|
||||
def delete_labels( self ):
|
||||
pass
|
||||
|
||||
def edit( self, title = None, body = None, assignee = None, state = None, milestone = None, labels = None ):
|
||||
pass
|
||||
|
||||
def get_comment( self, id ):
|
||||
pass
|
||||
|
||||
def get_comments( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/comments",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
IssueComment.IssueComment( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_events( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/events",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
IssueEvent.IssueEvent( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_labels( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/labels",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Label.Label( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def remove_from_labels( self, label ):
|
||||
pass
|
||||
|
||||
def set_labels( self, *labels ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "assignee" in attributes:
|
||||
self.__assignee = attributes[ "assignee" ]
|
||||
if "body" in attributes:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "closed_at" in attributes:
|
||||
self.__closed_at = attributes[ "closed_at" ]
|
||||
if "closed_by" in attributes:
|
||||
self.__closed_by = attributes[ "closed_by" ]
|
||||
if "comments" in attributes:
|
||||
self.__comments = attributes[ "comments" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "html_url" in attributes:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "labels" in attributes:
|
||||
self.__labels = attributes[ "labels" ]
|
||||
if "milestone" in attributes:
|
||||
self.__milestone = attributes[ "milestone" ]
|
||||
if "number" in attributes:
|
||||
self.__number = attributes[ "number" ]
|
||||
if "pull_request" in attributes:
|
||||
self.__pull_request = attributes[ "pull_request" ]
|
||||
if "state" in attributes:
|
||||
self.__state = attributes[ "state" ]
|
||||
if "title" in attributes:
|
||||
self.__title = attributes[ "title" ]
|
||||
if "updated_at" in attributes:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
self.__user = attributes[ "user" ]
|
||||
|
||||
@@ -1,13 +1,82 @@
|
||||
from NamedUser import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
IssueComment = GithubObject(
|
||||
"IssueComment",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/issues/comments/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "body", "created_at", "updated_at", "id",
|
||||
"_repo",
|
||||
),
|
||||
InternalObjectAttribute( "user", NamedUser ),
|
||||
Editable( Parameters( [ "body" ], [] ) ),
|
||||
Deletable(),
|
||||
)
|
||||
|
||||
class IssueComment( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def body( self ):
|
||||
if self.__body is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__body
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
if self.__updated_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
if self.__user is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__user
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__body = None
|
||||
self.__created_at = None
|
||||
self.__id = None
|
||||
self.__updated_at = None
|
||||
self.__url = None
|
||||
self.__user = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, body ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "body" in attributes:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "updated_at" in attributes:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
self.__user = attributes[ "user" ]
|
||||
|
||||
@@ -1,11 +1,85 @@
|
||||
from NamedUser import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
IssueEvent = GithubObject(
|
||||
"IssueEvent",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/issues/events/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"id", "url", "created_at", "issue", "event", "commit_id",
|
||||
"_repo",
|
||||
),
|
||||
InternalObjectAttribute( "actor", NamedUser ),
|
||||
)
|
||||
|
||||
class IssueEvent( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def actor( self ):
|
||||
if self.__actor is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__actor
|
||||
|
||||
@property
|
||||
def commit_id( self ):
|
||||
if self.__commit_id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__commit_id
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def event( self ):
|
||||
if self.__event is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__event
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def issue( self ):
|
||||
if self.__issue is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__issue
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__actor = None
|
||||
self.__commit_id = None
|
||||
self.__created_at = None
|
||||
self.__event = None
|
||||
self.__id = None
|
||||
self.__issue = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "actor" in attributes:
|
||||
self.__actor = attributes[ "actor" ]
|
||||
if "commit_id" in attributes:
|
||||
self.__commit_id = attributes[ "commit_id" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "event" in attributes:
|
||||
self.__event = attributes[ "event" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "issue" in attributes:
|
||||
self.__issue = attributes[ "issue" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,15 +1,55 @@
|
||||
import urllib
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
from GithubObject import *
|
||||
|
||||
Label = GithubObject(
|
||||
"Label",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/labels/" + obj._identity ),
|
||||
Identity( lambda obj: urllib.quote( obj.name ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "name", "color",
|
||||
"_repo",
|
||||
),
|
||||
Editable( Parameters( [ "name", "color" ], [] ) ),
|
||||
Deletable(),
|
||||
)
|
||||
class Label( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def color( self ):
|
||||
if self.__color is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__color
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
if self.__name is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__name
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__color = None
|
||||
self.__name = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, name, color ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "color" in attributes:
|
||||
self.__color = attributes[ "color" ]
|
||||
if "name" in attributes:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,20 +1,130 @@
|
||||
from NamedUser import *
|
||||
from Label import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
__modifyAttributesForObjectsReferingReferedRepo = { "_repo": lambda obj: obj._repo }
|
||||
|
||||
Milestone = GithubObject(
|
||||
"Milestone",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/milestones/" + str( obj.number ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "number", "state", "title", "description", "open_issues",
|
||||
"closed_issues", "created_at", "due_on",
|
||||
"_repo",
|
||||
),
|
||||
InternalObjectAttribute( "creator", NamedUser ),
|
||||
Editable( Parameters( [ "title" ], [ "state", "description", "due_on" ] ) ),
|
||||
Deletable(),
|
||||
ExternalListOfObjects( "labels", "label", Label,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo )
|
||||
),
|
||||
)
|
||||
class Milestone( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def closed_issues( self ):
|
||||
if self.__closed_issues is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__closed_issues
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def creator( self ):
|
||||
if self.__creator is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__creator
|
||||
|
||||
@property
|
||||
def description( self ):
|
||||
if self.__description is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__description
|
||||
|
||||
@property
|
||||
def due_on( self ):
|
||||
if self.__due_on is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__due_on
|
||||
|
||||
@property
|
||||
def number( self ):
|
||||
if self.__number is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__number
|
||||
|
||||
@property
|
||||
def open_issues( self ):
|
||||
if self.__open_issues is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__open_issues
|
||||
|
||||
@property
|
||||
def state( self ):
|
||||
if self.__state is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__state
|
||||
|
||||
@property
|
||||
def title( self ):
|
||||
if self.__title is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__title
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__closed_issues = None
|
||||
self.__created_at = None
|
||||
self.__creator = None
|
||||
self.__description = None
|
||||
self.__due_on = None
|
||||
self.__number = None
|
||||
self.__open_issues = None
|
||||
self.__state = None
|
||||
self.__title = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, title, state = None, description = None, due_on = None ):
|
||||
pass
|
||||
|
||||
def get_labels( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/labels",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Label.Label( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "closed_issues" in attributes:
|
||||
self.__closed_issues = attributes[ "closed_issues" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "creator" in attributes:
|
||||
self.__creator = attributes[ "creator" ]
|
||||
if "description" in attributes:
|
||||
self.__description = attributes[ "description" ]
|
||||
if "due_on" in attributes:
|
||||
self.__due_on = attributes[ "due_on" ]
|
||||
if "number" in attributes:
|
||||
self.__number = attributes[ "number" ]
|
||||
if "open_issues" in attributes:
|
||||
self.__open_issues = attributes[ "open_issues" ]
|
||||
if "state" in attributes:
|
||||
self.__state = attributes[ "state" ]
|
||||
if "title" in attributes:
|
||||
self.__title = attributes[ "title" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,30 +1,355 @@
|
||||
from GithubObject import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
NamedUser = GithubObject(
|
||||
"NamedUser",
|
||||
BaseUrl( lambda obj: "/users/" + obj.login ),
|
||||
Identity( lambda obj: obj.login ),
|
||||
InternalSimpleAttributes(
|
||||
"login", "id", "avatar_url", "gravatar_id", "url", "name", "company",
|
||||
"blog", "location", "email", "hireable", "bio", "public_repos",
|
||||
"public_gists", "followers", "following", "html_url", "created_at",
|
||||
"type",
|
||||
# Only in Repository.get_contributors()
|
||||
"contributions",
|
||||
# Seen only by user herself
|
||||
"disk_usage", "collaborators", "plan", "total_private_repos",
|
||||
"owned_private_repos", "private_gists",
|
||||
),
|
||||
)
|
||||
|
||||
NamedUser._addAttributePolicy(
|
||||
ExternalListOfObjects( "followers", "follower", NamedUser,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
)
|
||||
)
|
||||
class NamedUser( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
NamedUser._addAttributePolicy(
|
||||
ExternalListOfObjects( "following", "following", NamedUser,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
)
|
||||
)
|
||||
@property
|
||||
def avatar_url( self ):
|
||||
if self.__avatar_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__avatar_url
|
||||
|
||||
@property
|
||||
def bio( self ):
|
||||
if self.__bio is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__bio
|
||||
|
||||
@property
|
||||
def blog( self ):
|
||||
if self.__blog is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__blog
|
||||
|
||||
@property
|
||||
def collaborators( self ):
|
||||
if self.__collaborators is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__collaborators
|
||||
|
||||
@property
|
||||
def company( self ):
|
||||
if self.__company is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__company
|
||||
|
||||
@property
|
||||
def contributions( self ):
|
||||
if self.__contributions is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__contributions
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def disk_usage( self ):
|
||||
if self.__disk_usage is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__disk_usage
|
||||
|
||||
@property
|
||||
def email( self ):
|
||||
if self.__email is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__email
|
||||
|
||||
@property
|
||||
def followers( self ):
|
||||
if self.__followers is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__followers
|
||||
|
||||
@property
|
||||
def following( self ):
|
||||
if self.__following is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__following
|
||||
|
||||
@property
|
||||
def gravatar_id( self ):
|
||||
if self.__gravatar_id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__gravatar_id
|
||||
|
||||
@property
|
||||
def hireable( self ):
|
||||
if self.__hireable is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__hireable
|
||||
|
||||
@property
|
||||
def html_url( self ):
|
||||
if self.__html_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__html_url
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def location( self ):
|
||||
if self.__location is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__location
|
||||
|
||||
@property
|
||||
def login( self ):
|
||||
if self.__login is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__login
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
if self.__name is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__name
|
||||
|
||||
@property
|
||||
def owned_private_repos( self ):
|
||||
if self.__owned_private_repos is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__owned_private_repos
|
||||
|
||||
@property
|
||||
def plan( self ):
|
||||
if self.__plan is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__plan
|
||||
|
||||
@property
|
||||
def private_gists( self ):
|
||||
if self.__private_gists is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__private_gists
|
||||
|
||||
@property
|
||||
def public_gists( self ):
|
||||
if self.__public_gists is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__public_gists
|
||||
|
||||
@property
|
||||
def public_repos( self ):
|
||||
if self.__public_repos is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__public_repos
|
||||
|
||||
@property
|
||||
def total_private_repos( self ):
|
||||
if self.__total_private_repos is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__total_private_repos
|
||||
|
||||
@property
|
||||
def type( self ):
|
||||
if self.__type is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__type
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__avatar_url = None
|
||||
self.__bio = None
|
||||
self.__blog = None
|
||||
self.__collaborators = None
|
||||
self.__company = None
|
||||
self.__contributions = None
|
||||
self.__created_at = None
|
||||
self.__disk_usage = None
|
||||
self.__email = None
|
||||
self.__followers = None
|
||||
self.__following = None
|
||||
self.__gravatar_id = None
|
||||
self.__hireable = None
|
||||
self.__html_url = None
|
||||
self.__id = None
|
||||
self.__location = None
|
||||
self.__login = None
|
||||
self.__name = None
|
||||
self.__owned_private_repos = None
|
||||
self.__plan = None
|
||||
self.__private_gists = None
|
||||
self.__public_gists = None
|
||||
self.__public_repos = None
|
||||
self.__total_private_repos = None
|
||||
self.__type = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def create_gist( self, public, files, description = None ):
|
||||
pass
|
||||
|
||||
def get_events( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/events",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Event.Event( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_followers( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/followers",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
NamedUser.NamedUser( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_following( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/following",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
NamedUser.NamedUser( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_gists( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/gists",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Gist.Gist( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_orgs( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/orgs",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Organization.Organization( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_public_events( self ):
|
||||
pass
|
||||
|
||||
def get_public_received_events( self ):
|
||||
pass
|
||||
|
||||
def get_received_events( self ):
|
||||
pass
|
||||
|
||||
def get_repo( self, name ):
|
||||
pass
|
||||
|
||||
def get_repos( self, type = None ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/repos",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Repository.Repository( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_watched( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/watched",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Repository.Repository( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "avatar_url" in attributes:
|
||||
self.__avatar_url = attributes[ "avatar_url" ]
|
||||
if "bio" in attributes:
|
||||
self.__bio = attributes[ "bio" ]
|
||||
if "blog" in attributes:
|
||||
self.__blog = attributes[ "blog" ]
|
||||
if "collaborators" in attributes:
|
||||
self.__collaborators = attributes[ "collaborators" ]
|
||||
if "company" in attributes:
|
||||
self.__company = attributes[ "company" ]
|
||||
if "contributions" in attributes:
|
||||
self.__contributions = attributes[ "contributions" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "disk_usage" in attributes:
|
||||
self.__disk_usage = attributes[ "disk_usage" ]
|
||||
if "email" in attributes:
|
||||
self.__email = attributes[ "email" ]
|
||||
if "followers" in attributes:
|
||||
self.__followers = attributes[ "followers" ]
|
||||
if "following" in attributes:
|
||||
self.__following = attributes[ "following" ]
|
||||
if "gravatar_id" in attributes:
|
||||
self.__gravatar_id = attributes[ "gravatar_id" ]
|
||||
if "hireable" in attributes:
|
||||
self.__hireable = attributes[ "hireable" ]
|
||||
if "html_url" in attributes:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "location" in attributes:
|
||||
self.__location = attributes[ "location" ]
|
||||
if "login" in attributes:
|
||||
self.__login = attributes[ "login" ]
|
||||
if "name" in attributes:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "owned_private_repos" in attributes:
|
||||
self.__owned_private_repos = attributes[ "owned_private_repos" ]
|
||||
if "plan" in attributes:
|
||||
self.__plan = attributes[ "plan" ]
|
||||
if "private_gists" in attributes:
|
||||
self.__private_gists = attributes[ "private_gists" ]
|
||||
if "public_gists" in attributes:
|
||||
self.__public_gists = attributes[ "public_gists" ]
|
||||
if "public_repos" in attributes:
|
||||
self.__public_repos = attributes[ "public_repos" ]
|
||||
if "total_private_repos" in attributes:
|
||||
self.__total_private_repos = attributes[ "total_private_repos" ]
|
||||
if "type" in attributes:
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
from NamedUser import *
|
||||
|
||||
from Organization import *
|
||||
from Event import *
|
||||
from Repository import *
|
||||
from Gist import *
|
||||
|
||||
NamedUser._addAttributePolicy(
|
||||
ExternalListOfObjects( "orgs", "org", Organization,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
)
|
||||
)
|
||||
|
||||
NamedUser._addAttributePolicy(
|
||||
ExternalListOfObjects( "events", "event", Event,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
)
|
||||
)
|
||||
|
||||
def __getPublicEvents( user ):
|
||||
return [
|
||||
Event( user._github, attributes, lazy = True )
|
||||
for attributes
|
||||
in user._github._dataRequest( "GET", user._baseUrl() + "/events/public", None, None )
|
||||
]
|
||||
|
||||
NamedUser._addAttributePolicy(
|
||||
MethodFromCallable( "get_public_events", Parameters( [], [] ), __getPublicEvents, SimpleTypePolicy( "list of `Event`" ) )
|
||||
)
|
||||
|
||||
NamedUser._addAttributePolicy(
|
||||
ExternalListOfObjects( "received_events", "received_event", Event,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
)
|
||||
)
|
||||
|
||||
def __getPublicReceivedEvents( user ):
|
||||
return [
|
||||
Event( user._github, attributes, lazy = True )
|
||||
for attributes
|
||||
in user._github._dataRequest( "GET", user._baseUrl() + "/received_events/public", None, None )
|
||||
]
|
||||
|
||||
NamedUser._addAttributePolicy(
|
||||
MethodFromCallable( "get_public_received_events", Parameters( [], [] ), __getPublicReceivedEvents, SimpleTypePolicy( "list of `Event`" ) )
|
||||
)
|
||||
|
||||
NamedUser._addAttributePolicy(
|
||||
ExternalListOfObjects( "repos", "repo", Repository,
|
||||
ListGetable( Parameters( [], [ "type" ] ) ),
|
||||
ElementGetable( Parameters( [ "name" ], [] ), { "owner" : lambda user: { "login": user.login } } )
|
||||
)
|
||||
)
|
||||
|
||||
NamedUser._addAttributePolicy(
|
||||
ExternalListOfObjects( "watched", "watched", Repository,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
)
|
||||
)
|
||||
|
||||
NamedUser._addAttributePolicy(
|
||||
ExternalListOfObjects( "gists", "gist", Gist,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementCreatable( Parameters( [ "public", "files" ], [ "description" ] ) ),
|
||||
)
|
||||
)
|
||||
@@ -1,27 +1,328 @@
|
||||
from NamedUser import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
Organization = GithubObject(
|
||||
"Organization",
|
||||
BaseUrl( lambda obj: "/orgs/" + obj.login ),
|
||||
Identity( lambda obj: obj.login ),
|
||||
InternalSimpleAttributes(
|
||||
"login", "id", "url", "avatar_url", "name", "company", "blog",
|
||||
"location", "email", "public_repos", "public_gists", "followers",
|
||||
"following", "html_url", "created_at", "type", "gravatar_id",
|
||||
# Seen only by owners
|
||||
"disk_usage", "collaborators", "billing_email", "plan", "private_gists",
|
||||
"total_private_repos", "owned_private_repos",
|
||||
),
|
||||
Editable( Parameters( [], [ "billing_email", "blog", "company", "email", "location", "name" ] ) ),
|
||||
ExternalListOfObjects( "public_members", "public_member", NamedUser,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementAddable(),
|
||||
ElementRemovable(),
|
||||
ElementHasable()
|
||||
),
|
||||
ExternalListOfObjects( "members", "member", NamedUser,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementRemovable(),
|
||||
ElementHasable()
|
||||
),
|
||||
)
|
||||
|
||||
class Organization( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def avatar_url( self ):
|
||||
if self.__avatar_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__avatar_url
|
||||
|
||||
@property
|
||||
def billing_email( self ):
|
||||
if self.__billing_email is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__billing_email
|
||||
|
||||
@property
|
||||
def blog( self ):
|
||||
if self.__blog is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__blog
|
||||
|
||||
@property
|
||||
def collaborators( self ):
|
||||
if self.__collaborators is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__collaborators
|
||||
|
||||
@property
|
||||
def company( self ):
|
||||
if self.__company is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__company
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def disk_usage( self ):
|
||||
if self.__disk_usage is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__disk_usage
|
||||
|
||||
@property
|
||||
def email( self ):
|
||||
if self.__email is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__email
|
||||
|
||||
@property
|
||||
def followers( self ):
|
||||
if self.__followers is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__followers
|
||||
|
||||
@property
|
||||
def following( self ):
|
||||
if self.__following is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__following
|
||||
|
||||
@property
|
||||
def gravatar_id( self ):
|
||||
if self.__gravatar_id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__gravatar_id
|
||||
|
||||
@property
|
||||
def html_url( self ):
|
||||
if self.__html_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__html_url
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def location( self ):
|
||||
if self.__location is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__location
|
||||
|
||||
@property
|
||||
def login( self ):
|
||||
if self.__login is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__login
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
if self.__name is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__name
|
||||
|
||||
@property
|
||||
def owned_private_repos( self ):
|
||||
if self.__owned_private_repos is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__owned_private_repos
|
||||
|
||||
@property
|
||||
def plan( self ):
|
||||
if self.__plan is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__plan
|
||||
|
||||
@property
|
||||
def private_gists( self ):
|
||||
if self.__private_gists is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__private_gists
|
||||
|
||||
@property
|
||||
def public_gists( self ):
|
||||
if self.__public_gists is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__public_gists
|
||||
|
||||
@property
|
||||
def public_repos( self ):
|
||||
if self.__public_repos is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__public_repos
|
||||
|
||||
@property
|
||||
def total_private_repos( self ):
|
||||
if self.__total_private_repos is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__total_private_repos
|
||||
|
||||
@property
|
||||
def type( self ):
|
||||
if self.__type is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__type
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__avatar_url = None
|
||||
self.__billing_email = None
|
||||
self.__blog = None
|
||||
self.__collaborators = None
|
||||
self.__company = None
|
||||
self.__created_at = None
|
||||
self.__disk_usage = None
|
||||
self.__email = None
|
||||
self.__followers = None
|
||||
self.__following = None
|
||||
self.__gravatar_id = None
|
||||
self.__html_url = None
|
||||
self.__id = None
|
||||
self.__location = None
|
||||
self.__login = None
|
||||
self.__name = None
|
||||
self.__owned_private_repos = None
|
||||
self.__plan = None
|
||||
self.__private_gists = None
|
||||
self.__public_gists = None
|
||||
self.__public_repos = None
|
||||
self.__total_private_repos = None
|
||||
self.__type = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def add_to_public_members( self, public_member ):
|
||||
pass
|
||||
|
||||
def create_fork( self, repo ):
|
||||
pass
|
||||
|
||||
def create_repo( self, name, description = None, homepage = None, private = None, has_issues = None, has_wiki = None, has_downloads = None, team_id = None ):
|
||||
pass
|
||||
|
||||
def create_team( self, name, repo_names = None, permission = None ):
|
||||
pass
|
||||
|
||||
def edit( self, billing_email = None, blog = None, company = None, email = None, location = None, name = None ):
|
||||
pass
|
||||
|
||||
def get_events( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/events",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Event.Event( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_members( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/members",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
NamedUser.NamedUser( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_public_members( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/public_members",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
NamedUser.NamedUser( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_repo( self, name ):
|
||||
pass
|
||||
|
||||
def get_repos( self, type = None ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/repos",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Repository.Repository( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_teams( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/teams",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Team.Team( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def has_in_members( self, member ):
|
||||
pass
|
||||
|
||||
def has_in_public_members( self, public_member ):
|
||||
pass
|
||||
|
||||
def remove_from_members( self, member ):
|
||||
pass
|
||||
|
||||
def remove_from_public_members( self, public_member ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "avatar_url" in attributes:
|
||||
self.__avatar_url = attributes[ "avatar_url" ]
|
||||
if "billing_email" in attributes:
|
||||
self.__billing_email = attributes[ "billing_email" ]
|
||||
if "blog" in attributes:
|
||||
self.__blog = attributes[ "blog" ]
|
||||
if "collaborators" in attributes:
|
||||
self.__collaborators = attributes[ "collaborators" ]
|
||||
if "company" in attributes:
|
||||
self.__company = attributes[ "company" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "disk_usage" in attributes:
|
||||
self.__disk_usage = attributes[ "disk_usage" ]
|
||||
if "email" in attributes:
|
||||
self.__email = attributes[ "email" ]
|
||||
if "followers" in attributes:
|
||||
self.__followers = attributes[ "followers" ]
|
||||
if "following" in attributes:
|
||||
self.__following = attributes[ "following" ]
|
||||
if "gravatar_id" in attributes:
|
||||
self.__gravatar_id = attributes[ "gravatar_id" ]
|
||||
if "html_url" in attributes:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "location" in attributes:
|
||||
self.__location = attributes[ "location" ]
|
||||
if "login" in attributes:
|
||||
self.__login = attributes[ "login" ]
|
||||
if "name" in attributes:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "owned_private_repos" in attributes:
|
||||
self.__owned_private_repos = attributes[ "owned_private_repos" ]
|
||||
if "plan" in attributes:
|
||||
self.__plan = attributes[ "plan" ]
|
||||
if "private_gists" in attributes:
|
||||
self.__private_gists = attributes[ "private_gists" ]
|
||||
if "public_gists" in attributes:
|
||||
self.__public_gists = attributes[ "public_gists" ]
|
||||
if "public_repos" in attributes:
|
||||
self.__public_repos = attributes[ "public_repos" ]
|
||||
if "total_private_repos" in attributes:
|
||||
self.__total_private_repos = attributes[ "total_private_repos" ]
|
||||
if "type" in attributes:
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
from Organization import *
|
||||
|
||||
from Repository import *
|
||||
from Team import *
|
||||
from Event import *
|
||||
|
||||
Organization._addAttributePolicy(
|
||||
ExternalListOfObjects( "repos", "repo", Repository,
|
||||
ListGetable( Parameters( [], [ "type" ] ) ),
|
||||
ElementGetable( Parameters( [ "name" ], [] ), { "owner" : lambda user: { "login": user.login } } ),
|
||||
ElementCreatable( Parameters( [ "name" ], [ "description", "homepage", "private", "has_issues", "has_wiki", "has_downloads", "team_id", ] ) )
|
||||
)
|
||||
)
|
||||
|
||||
def __createForkForOrg( org, repo ):
|
||||
assert isinstance( repo, Repository )
|
||||
return Repository( org._github, org._github._dataRequest( "POST", repo._baseUrl() + "/forks", { "org": org.login }, None ), lazy = True )
|
||||
|
||||
Organization._addAttributePolicy(
|
||||
SeveralAttributePolicies( [ MethodFromCallable( "create_fork", Parameters( [ "repo" ], [] ), __createForkForOrg, ObjectTypePolicy( Repository ) ) ], "Forking" )
|
||||
)
|
||||
|
||||
Organization._addAttributePolicy(
|
||||
ExternalListOfObjects( "teams", "team", Team,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementCreatable( Parameters( [ "name" ], [ "repo_names", "permission" ] ) )
|
||||
)
|
||||
)
|
||||
|
||||
Organization._addAttributePolicy(
|
||||
ExternalListOfObjects( "events", "event", Event,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
),
|
||||
)
|
||||
@@ -1,40 +1,304 @@
|
||||
from NamedUser import *
|
||||
from Commit import *
|
||||
from PullRequestFile import *
|
||||
from PullRequestComment import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
__modifyAttributesForObjectsReferingReferedRepo = { "_repo": lambda obj: obj._repo }
|
||||
|
||||
def __pullRequestIsMerged( r ):
|
||||
return r._github._statusRequest( "GET", r._baseUrl() + "/merge", None, None ) == 204
|
||||
class PullRequest( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
def __mergePullRequest( r, **data ):
|
||||
r._github._statusRequest( "PUT", r._baseUrl() + "/merge", None, data )
|
||||
@property
|
||||
def additions( self ):
|
||||
if self.__additions is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__additions
|
||||
|
||||
PullRequest = GithubObject(
|
||||
"PullRequest",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/pulls/" + str( obj.number ) ),
|
||||
InternalSimpleAttributes(
|
||||
"id", "url", "html_url", "diff_url", "patch_url", "issue_url", "number",
|
||||
"state", "title", "body", "created_at", "updated_at", "closed_at",
|
||||
"merged_at", "_links", "merged", "mergeable", "comments", "commits",
|
||||
"additions", "deletions", "changed_files", "head", "base", "merged_by",
|
||||
"review_comments",
|
||||
"_repo",
|
||||
),
|
||||
InternalObjectAttribute( "user", NamedUser ),
|
||||
Editable( Parameters( [], [ "title", "body", "state" ] ) ),
|
||||
ExternalListOfObjects( "commits", "commit", Commit,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ),
|
||||
),
|
||||
ExternalListOfObjects( "files", "file", PullRequestFile,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
),
|
||||
ExternalListOfObjects( "comments", "comment", PullRequestComment,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ),
|
||||
ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingReferedRepo ),
|
||||
ElementCreatable( Alternative( Parameters( [ "body", "commit_id", "path", "position" ], [] ), Parameters( [ "body", "in_reply_to" ], [] ) ), __modifyAttributesForObjectsReferingReferedRepo ),
|
||||
),
|
||||
MethodFromCallable( "is_merged", Parameters( [], [] ), __pullRequestIsMerged, SimpleTypePolicy( "bool" ) ),
|
||||
MethodFromCallable( "merge", Parameters( [], [ "commit_message" ] ), __mergePullRequest, SimpleTypePolicy( None ) ),
|
||||
)
|
||||
@property
|
||||
def base( self ):
|
||||
if self.__base is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__base
|
||||
|
||||
@property
|
||||
def body( self ):
|
||||
if self.__body is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__body
|
||||
|
||||
@property
|
||||
def changed_files( self ):
|
||||
if self.__changed_files is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__changed_files
|
||||
|
||||
@property
|
||||
def closed_at( self ):
|
||||
if self.__closed_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__closed_at
|
||||
|
||||
@property
|
||||
def comments( self ):
|
||||
if self.__comments is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__comments
|
||||
|
||||
@property
|
||||
def commits( self ):
|
||||
if self.__commits is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__commits
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def deletions( self ):
|
||||
if self.__deletions is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__deletions
|
||||
|
||||
@property
|
||||
def diff_url( self ):
|
||||
if self.__diff_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__diff_url
|
||||
|
||||
@property
|
||||
def head( self ):
|
||||
if self.__head is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__head
|
||||
|
||||
@property
|
||||
def html_url( self ):
|
||||
if self.__html_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__html_url
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def issue_url( self ):
|
||||
if self.__issue_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__issue_url
|
||||
|
||||
@property
|
||||
def mergeable( self ):
|
||||
if self.__mergeable is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__mergeable
|
||||
|
||||
@property
|
||||
def merged( self ):
|
||||
if self.__merged is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__merged
|
||||
|
||||
@property
|
||||
def merged_at( self ):
|
||||
if self.__merged_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__merged_at
|
||||
|
||||
@property
|
||||
def merged_by( self ):
|
||||
if self.__merged_by is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__merged_by
|
||||
|
||||
@property
|
||||
def number( self ):
|
||||
if self.__number is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__number
|
||||
|
||||
@property
|
||||
def patch_url( self ):
|
||||
if self.__patch_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__patch_url
|
||||
|
||||
@property
|
||||
def review_comments( self ):
|
||||
if self.__review_comments is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__review_comments
|
||||
|
||||
@property
|
||||
def state( self ):
|
||||
if self.__state is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__state
|
||||
|
||||
@property
|
||||
def title( self ):
|
||||
if self.__title is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__title
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
if self.__updated_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
if self.__user is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__user
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__additions = None
|
||||
self.__base = None
|
||||
self.__body = None
|
||||
self.__changed_files = None
|
||||
self.__closed_at = None
|
||||
self.__comments = None
|
||||
self.__commits = None
|
||||
self.__created_at = None
|
||||
self.__deletions = None
|
||||
self.__diff_url = None
|
||||
self.__head = None
|
||||
self.__html_url = None
|
||||
self.__id = None
|
||||
self.__issue_url = None
|
||||
self.__mergeable = None
|
||||
self.__merged = None
|
||||
self.__merged_at = None
|
||||
self.__merged_by = None
|
||||
self.__number = None
|
||||
self.__patch_url = None
|
||||
self.__review_comments = None
|
||||
self.__state = None
|
||||
self.__title = None
|
||||
self.__updated_at = None
|
||||
self.__url = None
|
||||
self.__user = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, title = None, body = None, state = None ):
|
||||
pass
|
||||
|
||||
def get_comment( self, id ):
|
||||
pass
|
||||
|
||||
def get_comments( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/comments",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
PullRequestComment.PullRequestComment( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_commits( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/commits",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Commit.Commit( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_files( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/files",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
PullRequestFile.PullRequestFile( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def is_merged( self ):
|
||||
pass
|
||||
|
||||
def merge( self, commit_message = None ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "additions" in attributes:
|
||||
self.__additions = attributes[ "additions" ]
|
||||
if "base" in attributes:
|
||||
self.__base = attributes[ "base" ]
|
||||
if "body" in attributes:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "changed_files" in attributes:
|
||||
self.__changed_files = attributes[ "changed_files" ]
|
||||
if "closed_at" in attributes:
|
||||
self.__closed_at = attributes[ "closed_at" ]
|
||||
if "comments" in attributes:
|
||||
self.__comments = attributes[ "comments" ]
|
||||
if "commits" in attributes:
|
||||
self.__commits = attributes[ "commits" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "deletions" in attributes:
|
||||
self.__deletions = attributes[ "deletions" ]
|
||||
if "diff_url" in attributes:
|
||||
self.__diff_url = attributes[ "diff_url" ]
|
||||
if "head" in attributes:
|
||||
self.__head = attributes[ "head" ]
|
||||
if "html_url" in attributes:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "issue_url" in attributes:
|
||||
self.__issue_url = attributes[ "issue_url" ]
|
||||
if "mergeable" in attributes:
|
||||
self.__mergeable = attributes[ "mergeable" ]
|
||||
if "merged" in attributes:
|
||||
self.__merged = attributes[ "merged" ]
|
||||
if "merged_at" in attributes:
|
||||
self.__merged_at = attributes[ "merged_at" ]
|
||||
if "merged_by" in attributes:
|
||||
self.__merged_by = attributes[ "merged_by" ]
|
||||
if "number" in attributes:
|
||||
self.__number = attributes[ "number" ]
|
||||
if "patch_url" in attributes:
|
||||
self.__patch_url = attributes[ "patch_url" ]
|
||||
if "review_comments" in attributes:
|
||||
self.__review_comments = attributes[ "review_comments" ]
|
||||
if "state" in attributes:
|
||||
self.__state = attributes[ "state" ]
|
||||
if "title" in attributes:
|
||||
self.__title = attributes[ "title" ]
|
||||
if "updated_at" in attributes:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
self.__user = attributes[ "user" ]
|
||||
|
||||
@@ -1,14 +1,127 @@
|
||||
from NamedUser import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
PullRequestComment = GithubObject(
|
||||
"PullRequestComment",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/pulls/comments/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "id", "body", "path", "position", "commit_id",
|
||||
"created_at", "updated_at", "html_url", "line",
|
||||
"_repo",
|
||||
),
|
||||
InternalObjectAttribute( "user", NamedUser ),
|
||||
Editable( Parameters( [ "body" ], [] ) ),
|
||||
Deletable(),
|
||||
)
|
||||
|
||||
class PullRequestComment( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def body( self ):
|
||||
if self.__body is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__body
|
||||
|
||||
@property
|
||||
def commit_id( self ):
|
||||
if self.__commit_id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__commit_id
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def html_url( self ):
|
||||
if self.__html_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__html_url
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def line( self ):
|
||||
if self.__line is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__line
|
||||
|
||||
@property
|
||||
def path( self ):
|
||||
if self.__path is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__path
|
||||
|
||||
@property
|
||||
def position( self ):
|
||||
if self.__position is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__position
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
if self.__updated_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
if self.__user is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__user
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__body = None
|
||||
self.__commit_id = None
|
||||
self.__created_at = None
|
||||
self.__html_url = None
|
||||
self.__id = None
|
||||
self.__line = None
|
||||
self.__path = None
|
||||
self.__position = None
|
||||
self.__updated_at = None
|
||||
self.__url = None
|
||||
self.__user = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, body ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "body" in attributes:
|
||||
self.__body = attributes[ "body" ]
|
||||
if "commit_id" in attributes:
|
||||
self.__commit_id = attributes[ "commit_id" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "html_url" in attributes:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "line" in attributes:
|
||||
self.__line = attributes[ "line" ]
|
||||
if "path" in attributes:
|
||||
self.__path = attributes[ "path" ]
|
||||
if "position" in attributes:
|
||||
self.__position = attributes[ "position" ]
|
||||
if "updated_at" in attributes:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes:
|
||||
self.__user = attributes[ "user" ]
|
||||
|
||||
@@ -1,9 +1,103 @@
|
||||
from GithubObject import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
PullRequestFile = GithubObject(
|
||||
"PullRequestFile",
|
||||
InternalSimpleAttributes(
|
||||
"sha", "filename", "status", "additions", "deletions", "changes",
|
||||
"blob_url", "raw_url", "patch",
|
||||
),
|
||||
)
|
||||
|
||||
class PullRequestFile( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def additions( self ):
|
||||
if self.__additions is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__additions
|
||||
|
||||
@property
|
||||
def blob_url( self ):
|
||||
if self.__blob_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__blob_url
|
||||
|
||||
@property
|
||||
def changes( self ):
|
||||
if self.__changes is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__changes
|
||||
|
||||
@property
|
||||
def deletions( self ):
|
||||
if self.__deletions is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__deletions
|
||||
|
||||
@property
|
||||
def filename( self ):
|
||||
if self.__filename is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__filename
|
||||
|
||||
@property
|
||||
def patch( self ):
|
||||
if self.__patch is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__patch
|
||||
|
||||
@property
|
||||
def raw_url( self ):
|
||||
if self.__raw_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__raw_url
|
||||
|
||||
@property
|
||||
def sha( self ):
|
||||
if self.__sha is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__sha
|
||||
|
||||
@property
|
||||
def status( self ):
|
||||
if self.__status is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__status
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__additions = None
|
||||
self.__blob_url = None
|
||||
self.__changes = None
|
||||
self.__deletions = None
|
||||
self.__filename = None
|
||||
self.__patch = None
|
||||
self.__raw_url = None
|
||||
self.__sha = None
|
||||
self.__status = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "additions" in attributes:
|
||||
self.__additions = attributes[ "additions" ]
|
||||
if "blob_url" in attributes:
|
||||
self.__blob_url = attributes[ "blob_url" ]
|
||||
if "changes" in attributes:
|
||||
self.__changes = attributes[ "changes" ]
|
||||
if "deletions" in attributes:
|
||||
self.__deletions = attributes[ "deletions" ]
|
||||
if "filename" in attributes:
|
||||
self.__filename = attributes[ "filename" ]
|
||||
if "patch" in attributes:
|
||||
self.__patch = attributes[ "patch" ]
|
||||
if "raw_url" in attributes:
|
||||
self.__raw_url = attributes[ "raw_url" ]
|
||||
if "sha" in attributes:
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "status" in attributes:
|
||||
self.__status = attributes[ "status" ]
|
||||
|
||||
+616
-141
@@ -1,144 +1,619 @@
|
||||
from NamedUser import *
|
||||
from IssueEvent import *
|
||||
from RepositoryKey import *
|
||||
from Hook import *
|
||||
from GitBlob import *
|
||||
from GitCommit import *
|
||||
from GitRef import *
|
||||
from GitTag import *
|
||||
from GitTree import *
|
||||
from Label import *
|
||||
from Milestone import *
|
||||
from Issue import *
|
||||
from Download import *
|
||||
from CommitComment import *
|
||||
from Commit import *
|
||||
from Tag import *
|
||||
from Branch import *
|
||||
from PullRequest import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
__modifyAttributesForObjectsReferingRepo = { "_repo": lambda repo: repo }
|
||||
__modifyAttributesForGitTree = { "_repo": lambda repo: repo, "recursive": lambda repo: False }
|
||||
|
||||
def __compare( repo, base, head ):
|
||||
return repo._github._dataRequest( "GET", repo._baseUrl() + "/compare/" + base + "..." + head, None, None )
|
||||
class Repository( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
Repository = GithubObject(
|
||||
"Repository",
|
||||
BaseUrl( lambda obj: "/repos/" + obj.owner.login + "/" + obj.name ),
|
||||
Identity( lambda obj: obj.owner.login + "/" + obj.name ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "html_url", "clone_url", "git_url", "ssh_url", "svn_url",
|
||||
"name", "description", "homepage", "language", "private",
|
||||
"fork", "forks", "watchers", "size", "master_branch", "open_issues",
|
||||
"pushed_at", "created_at", "organization",
|
||||
"has_issues", "has_wiki", "has_downloads",
|
||||
# Not documented
|
||||
"mirror_url", "updated_at", "id", "permissions",
|
||||
),
|
||||
InternalObjectAttribute( "owner", NamedUser ),
|
||||
)
|
||||
Repository._addAttributePolicy( InternalObjectAttribute( "parent", Repository ) )
|
||||
Repository._addAttributePolicy( InternalObjectAttribute( "source", Repository ) )
|
||||
Repository._addAttributePolicy(
|
||||
ExternalListOfObjects( "issues/events", "issues_event", IssueEvent,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
)
|
||||
)
|
||||
Repository._addAttributePolicy(
|
||||
ExternalListOfObjects( "forks", "fork", Repository,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
)
|
||||
)
|
||||
Repository._addAttributePolicy(
|
||||
Editable( Parameters( [ "name" ], [ "description", "homepage", "public", "has_issues", "has_wiki", "has_downloads" ] ) )
|
||||
)
|
||||
Repository._addAttributePolicy(
|
||||
SeveralAttributePolicies( [ ExternalSimpleAttribute( "languages", "dictionary of strings to integers" ) ], "Languages" )
|
||||
)
|
||||
Repository._addAttributePolicy( SeveralAttributePolicies( [
|
||||
ExternalListOfObjects( "hooks", "hook", Hook,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Parameters( [ "name", "config" ], [ "events", "active" ] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
),
|
||||
ExternalListOfObjects( "keys", "key", RepositoryKey,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Parameters( [ "title", "key" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
),
|
||||
ExternalListOfObjects( "collaborators", "collaborator", NamedUser,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementAddable(),
|
||||
ElementRemovable(),
|
||||
ElementHasable()
|
||||
),
|
||||
ExternalListOfObjects( "contributors", "contributor", NamedUser,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
),
|
||||
ExternalListOfObjects( "watchers", "watcher", NamedUser,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
),
|
||||
ExternalListOfObjects( "git/refs", "git_ref", GitRef,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( Parameters( [ "ref" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Parameters( [ "ref", "sha" ], [] ), __modifyAttributesForObjectsReferingRepo )
|
||||
),
|
||||
ExternalListOfObjects( "git/commits", "git_commit", GitCommit,
|
||||
ElementGetable( Parameters( [ "sha" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Parameters( [ "message", "tree", "parents" ], [ "author", "committer" ] ), __modifyAttributesForObjectsReferingRepo )
|
||||
),
|
||||
ExternalListOfObjects( "git/trees", "git_tree", GitTree,
|
||||
ElementGetable( Parameters( [ "sha" ], [ "recursive" ] ), __modifyAttributesForGitTree ),
|
||||
ElementCreatable( Parameters( [ "tree" ], [ "base_tree" ] ), __modifyAttributesForGitTree )
|
||||
),
|
||||
ExternalListOfObjects( "git/blobs", "git_blob", GitBlob,
|
||||
ElementGetable( Parameters( [ "sha" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Parameters( [ "content", "encoding" ], [] ), __modifyAttributesForObjectsReferingRepo )
|
||||
),
|
||||
ExternalListOfObjects( "git/tags", "git_tag", GitTag,
|
||||
ElementGetable( Parameters( [ "sha" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Parameters( [ "tag", "message", "object", "type" ], [ "tagger" ] ), __modifyAttributesForObjectsReferingRepo )
|
||||
),
|
||||
ExternalListOfObjects( "labels", "label", Label,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( Parameters( [ "name" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Parameters( [ "name", "color" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
),
|
||||
ExternalListOfObjects( "milestones", "milestone", Milestone,
|
||||
ListGetable( Parameters( [], [ "state", "sort", "direction" ] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( Parameters( [ "number" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Parameters( [ "title" ], [ "state", "description", "due_on" ] ), __modifyAttributesForObjectsReferingRepo )
|
||||
),
|
||||
ExternalListOfObjects( "issues", "issue", Issue,
|
||||
ListGetable( Parameters( [], [ "milestone", "state", "assignee", "mentioned", "labels", "sort", "direction", "since" ] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( Parameters( [ "number" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Parameters( [ "title" ], [ "body", "assignee", "milestone", "labels", ] ), __modifyAttributesForObjectsReferingRepo )
|
||||
),
|
||||
ExternalListOfObjects( "downloads", "download", Download,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Parameters( [ "name", "size" ], [ "description", "content_type" ] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
),
|
||||
ExternalListOfObjects( "comments", "comment", CommitComment,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
),
|
||||
ExternalListOfObjects( "commits", "commit", Commit,
|
||||
ListGetable( Parameters( [], [ "sha", "path" ] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( Parameters( [ "sha" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
),
|
||||
ExternalListOfObjects( "tags", "tag", Tag,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
),
|
||||
ExternalListOfObjects( "branches", "branch", Branch,
|
||||
ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
),
|
||||
ExternalListOfObjects( "pulls", "pull", PullRequest,
|
||||
ListGetable( Parameters( [], [ "state" ] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( Parameters( [ "number" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Alternative( Parameters( [ "title", "body", "base", "head" ], [] ), Parameters( [ "issue", "base", "head" ], [] ) ), __modifyAttributesForObjectsReferingRepo ),
|
||||
),
|
||||
MethodFromCallable( "compare", Parameters( [ "base", "head" ], [] ), __compare, SimpleTypePolicy( None ) ),
|
||||
] ) )
|
||||
@property
|
||||
def clone_url( self ):
|
||||
if self.__clone_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__clone_url
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
if self.__created_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def description( self ):
|
||||
if self.__description is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__description
|
||||
|
||||
@property
|
||||
def fork( self ):
|
||||
if self.__fork is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__fork
|
||||
|
||||
@property
|
||||
def forks( self ):
|
||||
if self.__forks is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__forks
|
||||
|
||||
@property
|
||||
def git_url( self ):
|
||||
if self.__git_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__git_url
|
||||
|
||||
@property
|
||||
def has_downloads( self ):
|
||||
if self.__has_downloads is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__has_downloads
|
||||
|
||||
@property
|
||||
def has_issues( self ):
|
||||
if self.__has_issues is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__has_issues
|
||||
|
||||
@property
|
||||
def has_wiki( self ):
|
||||
if self.__has_wiki is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__has_wiki
|
||||
|
||||
@property
|
||||
def homepage( self ):
|
||||
if self.__homepage is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__homepage
|
||||
|
||||
@property
|
||||
def html_url( self ):
|
||||
if self.__html_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__html_url
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def language( self ):
|
||||
if self.__language is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__language
|
||||
|
||||
@property
|
||||
def master_branch( self ):
|
||||
if self.__master_branch is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__master_branch
|
||||
|
||||
@property
|
||||
def mirror_url( self ):
|
||||
if self.__mirror_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__mirror_url
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
if self.__name is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__name
|
||||
|
||||
@property
|
||||
def open_issues( self ):
|
||||
if self.__open_issues is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__open_issues
|
||||
|
||||
@property
|
||||
def organization( self ):
|
||||
if self.__organization is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__organization
|
||||
|
||||
@property
|
||||
def owner( self ):
|
||||
if self.__owner is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__owner
|
||||
|
||||
@property
|
||||
def parent( self ):
|
||||
if self.__parent is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__parent
|
||||
|
||||
@property
|
||||
def permissions( self ):
|
||||
if self.__permissions is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__permissions
|
||||
|
||||
@property
|
||||
def private( self ):
|
||||
if self.__private is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__private
|
||||
|
||||
@property
|
||||
def pushed_at( self ):
|
||||
if self.__pushed_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__pushed_at
|
||||
|
||||
@property
|
||||
def size( self ):
|
||||
if self.__size is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__size
|
||||
|
||||
@property
|
||||
def source( self ):
|
||||
if self.__source is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__source
|
||||
|
||||
@property
|
||||
def ssh_url( self ):
|
||||
if self.__ssh_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__ssh_url
|
||||
|
||||
@property
|
||||
def svn_url( self ):
|
||||
if self.__svn_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__svn_url
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
if self.__updated_at is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
@property
|
||||
def watchers( self ):
|
||||
if self.__watchers is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__watchers
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__clone_url = None
|
||||
self.__created_at = None
|
||||
self.__description = None
|
||||
self.__fork = None
|
||||
self.__forks = None
|
||||
self.__git_url = None
|
||||
self.__has_downloads = None
|
||||
self.__has_issues = None
|
||||
self.__has_wiki = None
|
||||
self.__homepage = None
|
||||
self.__html_url = None
|
||||
self.__id = None
|
||||
self.__language = None
|
||||
self.__master_branch = None
|
||||
self.__mirror_url = None
|
||||
self.__name = None
|
||||
self.__open_issues = None
|
||||
self.__organization = None
|
||||
self.__owner = None
|
||||
self.__parent = None
|
||||
self.__permissions = None
|
||||
self.__private = None
|
||||
self.__pushed_at = None
|
||||
self.__size = None
|
||||
self.__source = None
|
||||
self.__ssh_url = None
|
||||
self.__svn_url = None
|
||||
self.__updated_at = None
|
||||
self.__url = None
|
||||
self.__watchers = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def add_to_collaborators( self, collaborator ):
|
||||
pass
|
||||
|
||||
def compare( self, base, head ):
|
||||
pass
|
||||
|
||||
def create_download( self, name, size, description = None, content_type = None ):
|
||||
pass
|
||||
|
||||
def create_git_blob( self, content, encoding ):
|
||||
pass
|
||||
|
||||
def create_git_commit( self, message, tree, parents, author = None, committer = None ):
|
||||
pass
|
||||
|
||||
def create_git_ref( self, ref, sha ):
|
||||
pass
|
||||
|
||||
def create_git_tag( self, tag, message, object, type, tagger = None ):
|
||||
pass
|
||||
|
||||
def create_git_tree( self, tree, base_tree = None ):
|
||||
pass
|
||||
|
||||
def create_hook( self, name, config, events = None, active = None ):
|
||||
pass
|
||||
|
||||
def create_issue( self, title, body = None, assignee = None, milestone = None, labels = None ):
|
||||
pass
|
||||
|
||||
def create_key( self, title, key ):
|
||||
pass
|
||||
|
||||
def create_label( self, name, color ):
|
||||
pass
|
||||
|
||||
def create_milestone( self, title, state = None, description = None, due_on = None ):
|
||||
pass
|
||||
|
||||
def edit( self, name, description = None, homepage = None, public = None, has_issues = None, has_wiki = None, has_downloads = None ):
|
||||
pass
|
||||
|
||||
def get_branches( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/branches",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Branch.Branch( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_collaborators( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/collaborators",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
NamedUser.NamedUser( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_comment( self, id ):
|
||||
pass
|
||||
|
||||
def get_comments( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/comments",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
CommitComment.CommitComment( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_commit( self, sha ):
|
||||
pass
|
||||
|
||||
def get_commits( self, sha = None, path = None ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/commits",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Commit.Commit( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_contributors( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/contributors",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
NamedUser.NamedUser( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_download( self, id ):
|
||||
pass
|
||||
|
||||
def get_downloads( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/downloads",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Download.Download( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_events( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/events",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Event.Event( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_forks( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/forks",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Repository.Repository( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_git_blob( self, sha ):
|
||||
pass
|
||||
|
||||
def get_git_commit( self, sha ):
|
||||
pass
|
||||
|
||||
def get_git_ref( self, ref ):
|
||||
pass
|
||||
|
||||
def get_git_refs( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/git_refs",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
GitRef.GitRef( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_git_tag( self, sha ):
|
||||
pass
|
||||
|
||||
def get_git_tree( self, sha, recursive = None ):
|
||||
pass
|
||||
|
||||
def get_hook( self, id ):
|
||||
pass
|
||||
|
||||
def get_hooks( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/hooks",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Hook.Hook( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_issue( self, number ):
|
||||
pass
|
||||
|
||||
def get_issues( self, milestone = None, state = None, assignee = None, mentioned = None, labels = None, sort = None, direction = None, since = None ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/issues",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Issue.Issue( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_issues_event( self, id ):
|
||||
pass
|
||||
|
||||
def get_issues_events( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/issues_events",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
IssueEvent.IssueEvent( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_key( self, id ):
|
||||
pass
|
||||
|
||||
def get_keys( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/keys",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
RepositoryKey.RepositoryKey( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_label( self, name ):
|
||||
pass
|
||||
|
||||
def get_labels( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/labels",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Label.Label( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_languages( self ):
|
||||
pass
|
||||
|
||||
def get_milestone( self, number ):
|
||||
pass
|
||||
|
||||
def get_milestones( self, state = None, sort = None, direction = None ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/milestones",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Milestone.Milestone( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_network_events( self ):
|
||||
pass
|
||||
|
||||
def get_pull( self, number ):
|
||||
pass
|
||||
|
||||
def get_pulls( self, state = None ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/pulls",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
PullRequest.PullRequest( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_tags( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/tags",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Tag.Tag( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_teams( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/teams",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Team.Team( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_watchers( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/watchers",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
NamedUser.NamedUser( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def has_in_collaborators( self, collaborator ):
|
||||
pass
|
||||
|
||||
def remove_from_collaborators( self, collaborator ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "clone_url" in attributes:
|
||||
self.__clone_url = attributes[ "clone_url" ]
|
||||
if "created_at" in attributes:
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "description" in attributes:
|
||||
self.__description = attributes[ "description" ]
|
||||
if "fork" in attributes:
|
||||
self.__fork = attributes[ "fork" ]
|
||||
if "forks" in attributes:
|
||||
self.__forks = attributes[ "forks" ]
|
||||
if "git_url" in attributes:
|
||||
self.__git_url = attributes[ "git_url" ]
|
||||
if "has_downloads" in attributes:
|
||||
self.__has_downloads = attributes[ "has_downloads" ]
|
||||
if "has_issues" in attributes:
|
||||
self.__has_issues = attributes[ "has_issues" ]
|
||||
if "has_wiki" in attributes:
|
||||
self.__has_wiki = attributes[ "has_wiki" ]
|
||||
if "homepage" in attributes:
|
||||
self.__homepage = attributes[ "homepage" ]
|
||||
if "html_url" in attributes:
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "language" in attributes:
|
||||
self.__language = attributes[ "language" ]
|
||||
if "master_branch" in attributes:
|
||||
self.__master_branch = attributes[ "master_branch" ]
|
||||
if "mirror_url" in attributes:
|
||||
self.__mirror_url = attributes[ "mirror_url" ]
|
||||
if "name" in attributes:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "open_issues" in attributes:
|
||||
self.__open_issues = attributes[ "open_issues" ]
|
||||
if "organization" in attributes:
|
||||
self.__organization = attributes[ "organization" ]
|
||||
if "owner" in attributes:
|
||||
self.__owner = attributes[ "owner" ]
|
||||
if "parent" in attributes:
|
||||
self.__parent = attributes[ "parent" ]
|
||||
if "permissions" in attributes:
|
||||
self.__permissions = attributes[ "permissions" ]
|
||||
if "private" in attributes:
|
||||
self.__private = attributes[ "private" ]
|
||||
if "pushed_at" in attributes:
|
||||
self.__pushed_at = attributes[ "pushed_at" ]
|
||||
if "size" in attributes:
|
||||
self.__size = attributes[ "size" ]
|
||||
if "source" in attributes:
|
||||
self.__source = attributes[ "source" ]
|
||||
if "ssh_url" in attributes:
|
||||
self.__ssh_url = attributes[ "ssh_url" ]
|
||||
if "svn_url" in attributes:
|
||||
self.__svn_url = attributes[ "svn_url" ]
|
||||
if "updated_at" in attributes:
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
if "watchers" in attributes:
|
||||
self.__watchers = attributes[ "watchers" ]
|
||||
|
||||
@@ -1,12 +1,64 @@
|
||||
from GithubObject import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
RepositoryKey = GithubObject(
|
||||
"RepositoryKey",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl() + "/keys/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "id", "title", "key",
|
||||
"_repo",
|
||||
),
|
||||
Editable( Parameters( [ "title", "key" ], [] ) ),
|
||||
Deletable()
|
||||
)
|
||||
|
||||
class RepositoryKey( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def key( self ):
|
||||
if self.__key is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__key
|
||||
|
||||
@property
|
||||
def title( self ):
|
||||
if self.__title is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__title
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__id = None
|
||||
self.__key = None
|
||||
self.__title = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, title, key ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "key" in attributes:
|
||||
self.__key = attributes[ "key" ]
|
||||
if "title" in attributes:
|
||||
self.__title = attributes[ "title" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
from Repository import *
|
||||
|
||||
from Team import *
|
||||
from Event import *
|
||||
|
||||
Repository._addAttributePolicy(
|
||||
ExternalListOfObjects( "teams", "team", Team,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
)
|
||||
)
|
||||
|
||||
Repository._addAttributePolicy(
|
||||
ExternalListOfObjects( "events", "event", Event,
|
||||
ListGetable( Parameters( [], [] ) )
|
||||
),
|
||||
)
|
||||
|
||||
def __getNetworkEvents( repo ):
|
||||
return [
|
||||
Event( repo._github, attributes, lazy = True )
|
||||
for attributes
|
||||
in repo._github._dataRequest( "GET", "/networks/" + repo.owner.login + "/" + repo.name + "/events", None, None )
|
||||
]
|
||||
|
||||
Repository._addAttributePolicy(
|
||||
MethodFromCallable( "get_network_events", Parameters( [], [] ), __getNetworkEvents, SimpleTypePolicy( "list of `Event`" ) )
|
||||
)
|
||||
@@ -1,10 +1,58 @@
|
||||
from Commit import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
Tag = GithubObject(
|
||||
"Tag",
|
||||
InternalSimpleAttributes(
|
||||
"name", "zipball_url", "tarball_url",
|
||||
"_repo",
|
||||
),
|
||||
InternalObjectAttribute( "commit", Commit )
|
||||
)
|
||||
|
||||
class Tag( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def commit( self ):
|
||||
if self.__commit is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__commit
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
if self.__name is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__name
|
||||
|
||||
@property
|
||||
def tarball_url( self ):
|
||||
if self.__tarball_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__tarball_url
|
||||
|
||||
@property
|
||||
def zipball_url( self ):
|
||||
if self.__zipball_url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__zipball_url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__commit = None
|
||||
self.__name = None
|
||||
self.__tarball_url = None
|
||||
self.__zipball_url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "commit" in attributes:
|
||||
self.__commit = attributes[ "commit" ]
|
||||
if "name" in attributes:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "tarball_url" in attributes:
|
||||
self.__tarball_url = attributes[ "tarball_url" ]
|
||||
if "zipball_url" in attributes:
|
||||
self.__zipball_url = attributes[ "zipball_url" ]
|
||||
|
||||
+123
-24
@@ -1,25 +1,124 @@
|
||||
from NamedUser import *
|
||||
from Repository import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
Team = GithubObject(
|
||||
"Team",
|
||||
BaseUrl( lambda obj: "/teams/" + str( obj.id ) ),
|
||||
Identity( lambda obj: str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "name", "id", "permission", "members_count", "repos_count",
|
||||
),
|
||||
Editable( Parameters( [ "name" ], [ "permission" ] ) ),
|
||||
Deletable(),
|
||||
ExternalListOfObjects( "members", "member", NamedUser,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementAddable(),
|
||||
ElementRemovable(),
|
||||
ElementHasable()
|
||||
),
|
||||
ExternalListOfObjects( "repos", "repo", Repository,
|
||||
ListGetable( Parameters( [], [] ) ),
|
||||
ElementAddable(),
|
||||
ElementRemovable(),
|
||||
ElementHasable()
|
||||
),
|
||||
)
|
||||
|
||||
class Team( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def members_count( self ):
|
||||
if self.__members_count is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__members_count
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
if self.__name is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__name
|
||||
|
||||
@property
|
||||
def permission( self ):
|
||||
if self.__permission is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__permission
|
||||
|
||||
@property
|
||||
def repos_count( self ):
|
||||
if self.__repos_count is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__repos_count
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__id = None
|
||||
self.__members_count = None
|
||||
self.__name = None
|
||||
self.__permission = None
|
||||
self.__repos_count = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def add_to_members( self, member ):
|
||||
pass
|
||||
|
||||
def add_to_repos( self, repo ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, name, permission = None ):
|
||||
pass
|
||||
|
||||
def get_members( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/members",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
NamedUser.NamedUser( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def get_repos( self ):
|
||||
result = self.__github._dataRequest(
|
||||
"GET",
|
||||
self.url + "/repos",
|
||||
None,
|
||||
None
|
||||
)
|
||||
return [
|
||||
Repository.Repository( self.__github, element, lazy = True )
|
||||
for element in result
|
||||
]
|
||||
|
||||
def has_in_members( self, member ):
|
||||
pass
|
||||
|
||||
def has_in_repos( self, repo ):
|
||||
pass
|
||||
|
||||
def remove_from_members( self, member ):
|
||||
pass
|
||||
|
||||
def remove_from_repos( self, repo ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "members_count" in attributes:
|
||||
self.__members_count = attributes[ "members_count" ]
|
||||
if "name" in attributes:
|
||||
self.__name = attributes[ "name" ]
|
||||
if "permission" in attributes:
|
||||
self.__permission = attributes[ "permission" ]
|
||||
if "repos_count" in attributes:
|
||||
self.__repos_count = attributes[ "repos_count" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,11 +1,64 @@
|
||||
from GithubObject import *
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
UserKey = GithubObject(
|
||||
"UserKey",
|
||||
BaseUrl( lambda obj: "/user/keys/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
"url", "id", "title", "key",
|
||||
),
|
||||
Editable( Parameters( [], [ "title", "key" ] ) ),
|
||||
Deletable(),
|
||||
)
|
||||
|
||||
class UserKey( object ):
|
||||
def __init__( self, github, attributes, lazy ):
|
||||
self.__github = github
|
||||
self.__completed = False
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
if self.__id is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def key( self ):
|
||||
if self.__key is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__key
|
||||
|
||||
@property
|
||||
def title( self ):
|
||||
if self.__title is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__title
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
if self.__url is None:
|
||||
self.__completeIfNeeded()
|
||||
return self.__url
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__id = None
|
||||
self.__key = None
|
||||
self.__title = None
|
||||
self.__url = None
|
||||
|
||||
def __completeIfNeeded( self ):
|
||||
if not self.__completed:
|
||||
self.__complete()
|
||||
self.__completed = True
|
||||
|
||||
def __complete( self ):
|
||||
pass
|
||||
|
||||
def delete( self ):
|
||||
pass
|
||||
|
||||
def edit( self, title = None, key = None ):
|
||||
pass
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
if "id" in attributes:
|
||||
self.__id = attributes[ "id" ]
|
||||
if "key" in attributes:
|
||||
self.__key = attributes[ "key" ]
|
||||
if "title" in attributes:
|
||||
self.__title = attributes[ "title" ]
|
||||
if "url" in attributes:
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
from AuthenticatedUser import *
|
||||
|
||||
# This strange import pattern works around cyclic dependencies
|
||||
from NamedUser import *
|
||||
from NamedUser_complete import *
|
||||
|
||||
from Organization import *
|
||||
from Organization_complete import *
|
||||
|
||||
from Repository import *
|
||||
from Repository_complete import *
|
||||
|
||||
from Gist import *
|
||||
|
||||
Reference in New Issue
Block a user