mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Repository.create_git_tag and .get_git_tag
This commit is contained in:
@@ -103,6 +103,18 @@ GitBlob = GithubObject(
|
||||
),
|
||||
)
|
||||
|
||||
GitTag = GithubObject(
|
||||
"GitTag",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl + "/git/tags/" + obj.sha ),
|
||||
BasicAttributes(
|
||||
"tag", "sha", "url",
|
||||
"message",
|
||||
"tagger", ### @todo Structure
|
||||
"object", ### @todo Structure
|
||||
"_repo", ### Ugly hack
|
||||
),
|
||||
)
|
||||
|
||||
__modifyAttributesForGitObjects = lambda obj, attributes: dict( itertools.chain( attributes.iteritems(), { "_repo": obj }.iteritems() ) )
|
||||
Repository = GithubObject(
|
||||
"Repository",
|
||||
@@ -139,6 +151,10 @@ Repository = GithubObject(
|
||||
ElementGetable( "git_blob", lambda repo, sha: { "_repo": repo, "sha": sha } ),
|
||||
ElementCreatable( "git_blob", [ "content", "encoding" ], [], __modifyAttributesForGitObjects )
|
||||
),
|
||||
ListAttribute( "git/tags", GitTag,
|
||||
ElementGetable( "git_tag", lambda repo, sha: { "_repo": repo, "sha": sha } ),
|
||||
ElementCreatable( "git_tag", [ "tag", "message", "object", "type" ], [ "tagger" ], __modifyAttributesForGitObjects )
|
||||
),
|
||||
)
|
||||
Repository._addAttributePolicy( ComplexAttribute( "parent", Repository ) )
|
||||
Repository._addAttributePolicy( ComplexAttribute( "source", Repository ) )
|
||||
|
||||
Reference in New Issue
Block a user