forked from sigmavirus24/github3.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlicenses.py
More file actions
35 lines (27 loc) · 1007 Bytes
/
licenses.py
File metadata and controls
35 lines (27 loc) · 1007 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
35
# -*- coding: utf-8 -*-
"""
github3.licenses
================
This module contains the classes relating to licenses
See also: https://developer.github.com/v3/licenses/
"""
from __future__ import unicode_literals
from .models import GitHubCore
class License(GitHubCore):
CUSTOM_HEADERS = {
'Accept': 'application/vnd.github.drax-preview+json'
}
def _update_attributes(self, license):
self.name = license.get('name')
self.permitted = license.get('permitted')
self.category = license.get('category')
self.forbidden = license.get('forbidden')
self.featured = license.get('featured')
self.html_url = license.get('html_url')
self.body = license.get('body')
self.key = license.get('key')
self.description = license.get('description')
self.implementation = license.get('implementation')
self.required = license.get('required')
def _repr(self):
return '<License [{0}]>'.format(self.name)