Spliting GithubObjects.py

This commit is contained in:
Vincent Jacques
2012-03-13 20:13:04 +01:00
parent 1c95ddfa09
commit 877dde23e1
2 changed files with 13 additions and 11 deletions
+1 -11
View File
@@ -34,21 +34,11 @@ from Branch import Branch
from PullRequestFile import PullRequestFile
from PullRequestComment import PullRequestComment
from PullRequest import PullRequest
from RepositoryKey import RepositoryKey
__modifyAttributesForObjectsReferingReferedRepo = { "_repo": lambda obj: obj._repo }
__modifyAttributesForObjectsReferingRepo = { "_repo": lambda repo: repo }
RepositoryKey = GithubObject(
"RepositoryKey",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/keys/" + str( obj.id ) ),
InternalSimpleAttributes(
"url", "id", "title", "key",
"_repo",
),
Editable( [ "title", "key" ], [] ),
Deletable()
)
Repository = GithubObject(
"Repository",
BaseUrl( lambda obj: "/repos/" + obj.owner.login + "/" + obj.name ),
+12
View File
@@ -0,0 +1,12 @@
from GithubObject import *
RepositoryKey = GithubObject(
"RepositoryKey",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/keys/" + str( obj.id ) ),
InternalSimpleAttributes(
"url", "id", "title", "key",
"_repo",
),
Editable( [ "title", "key" ], [] ),
Deletable()
)