forked from sigmavirus24/github3.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtag.py
More file actions
52 lines (33 loc) · 1.4 KB
/
Copy pathtag.py
File metadata and controls
52 lines (33 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""This module contains the RepoTag object for GitHub's tag API."""
from . import commit
from .. import models
class RepoTag(models.GitHubCore):
"""Representation of a tag made on a GitHub repository.
.. note::
This is distinct from :class:`~github3.git.Tag`. This object
has information specific to a tag on a *GitHub* repository.
That includes URLs to the tarball and zipball files auto-generated
by GitHub.
See also: http://developer.github.com/v3/repos/#list-tags
This object has the following attributes:
.. attribute:: commit
.. versionchanged:: 1.0.0
This attribute used to be a two item dictionary.
A :class:`~github3.repos.commit.MiniCommit` object representing the
commit this tag references.
.. attribute:: name
The name of this tag, e.g., ``v1.0.0``.
.. attribute:: tarball_url
The URL for the tarball file generated by GitHub for this tag.
.. attribute:: zipball_url
The URL for the zipball file generated by GitHub for this tag.
"""
def _update_attributes(self, tag):
self.commit = commit.MiniCommit(tag["commit"], self)
self.name = tag["name"]
self.tarball_url = tag["tarball_url"]
self.zipball_url = tag["zipball_url"]
def _repr(self):
return f"<Repository Tag [{self}]>"
def __str__(self):
return self.name