Spliting GithubObjects.py

This commit is contained in:
Vincent Jacques
2012-03-13 19:40:44 +01:00
parent 4a5cf98e7f
commit e648e5aeb5
6 changed files with 67 additions and 54 deletions
+11
View File
@@ -0,0 +1,11 @@
from GithubObject import *
GitBlob = GithubObject(
"GitBlob",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/blobs/" + obj.sha ),
InternalSimpleAttributes(
"sha", "size", "url",
"content", "encoding",
"_repo",
),
)
+15
View File
@@ -0,0 +1,15 @@
from GithubObject import *
from GitTree import GitTree
GitCommit = GithubObject(
"GitCommit",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/commits/" + obj.sha ),
InternalSimpleAttributes(
"sha", "url", "message",
"parents",
"author", "committer",
"_repo",
),
InternalObjectAttribute( "tree", GitTree ),
)
+12
View File
@@ -0,0 +1,12 @@
from GithubObject import *
GitRef = GithubObject(
"GitRef",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/" + obj.ref ),
InternalSimpleAttributes(
"ref", "url",
"object",
"_repo",
),
Editable( [ "sha" ], [ "force" ] ),
)
+13
View File
@@ -0,0 +1,13 @@
from GithubObject import *
GitTag = GithubObject(
"GitTag",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/tags/" + obj.sha ),
InternalSimpleAttributes(
"tag", "sha", "url",
"message",
"tagger",
"object",
"_repo",
),
)
+11
View File
@@ -0,0 +1,11 @@
from GithubObject import *
GitTree = GithubObject(
"GitTree",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/trees/" + obj.sha ),
InternalSimpleAttributes(
"sha", "url",
"tree",
"_repo",
),
)
+5 -54
View File
@@ -16,60 +16,11 @@ NamedUser._addAttributePolicy(
)
)
GitRef = GithubObject(
"GitRef",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/" + obj.ref ),
InternalSimpleAttributes(
"ref", "url",
"object",
"_repo",
),
Editable( [ "sha" ], [ "force" ] ),
)
GitTree = GithubObject(
"GitTree",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/trees/" + obj.sha ),
InternalSimpleAttributes(
"sha", "url",
"tree",
"_repo",
),
)
GitCommit = GithubObject(
"GitCommit",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/commits/" + obj.sha ),
InternalSimpleAttributes(
"sha", "url", "message",
"parents",
"author", "committer",
"_repo",
),
InternalObjectAttribute( "tree", GitTree ),
)
GitBlob = GithubObject(
"GitBlob",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/blobs/" + obj.sha ),
InternalSimpleAttributes(
"sha", "size", "url",
"content", "encoding",
"_repo",
),
)
GitTag = GithubObject(
"GitTag",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/tags/" + obj.sha ),
InternalSimpleAttributes(
"tag", "sha", "url",
"message",
"tagger",
"object",
"_repo",
),
)
from GitRef import GitRef
from GitTree import GitTree
from GitCommit import GitCommit
from GitBlob import GitBlob
from GitTag import GitTag
Label = GithubObject(
"Label",