forked from copitux/python-github3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtags.py
More file actions
34 lines (25 loc) · 913 Bytes
/
tags.py
File metadata and controls
34 lines (25 loc) · 913 Bytes
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
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from pygithub3.services.base import Service
class Tags(Service):
"""Consume `Tags API <http://developer.github.com/v3/git/tags/>`_"""
def get(self, sha, user=None, repo=None):
"""Get a tag
:param str sha: The sha of the tag to get.
:param str user: Username
:param str repo: Repository
"""
return self._get(
self.make_request('git_data.tags.get', sha=sha, user=user,
repo=repo)
)
def create(self, body, user=None, repo=None):
"""Create a tag
:param dict body: Data describing the tag to create
:param str user: Username
:param str repo: Repository
"""
return self._post(
self.make_request('git_data.tags.create', body=body, user=user,
repo=repo)
)