forked from sigmavirus24/github3.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpages.py
More file actions
55 lines (39 loc) · 1.63 KB
/
Copy pathpages.py
File metadata and controls
55 lines (39 loc) · 1.63 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
53
54
55
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from ..models import GitHubObject
class PagesInfo(GitHubObject):
def _update_attributes(self, info):
self._api = info.get('url')
#: Status of the pages site, e.g., built
self.status = info.get('status')
#: CName used for the pages site
self.cname = info.get('cname')
#: Boolean indicating whether there is a custom 404 for the pages site
self.custom_404 = info.get('custom_404')
def _repr(self):
info = self.cname or ''
if info:
info += '/'
info += self.status or ''
return '<Pages Info [{0}]>'.format(info)
class PagesBuild(GitHubObject):
def _update_attributes(self, build):
self._api = build.get('url')
#: Status of the pages build, e.g., building
self.status = build.get('status')
#: Error dictionary containing the error message
self.error = build.get('error')
from ..users import User
#: :class:`User <github3.users.User>` representing who pushed the
#: commit
self.pusher = User(build.get('pusher'))
#: SHA of the commit that triggered the build
self.commit = build.get('commit')
#: Time the build took to finish
self.duration = build.get('duration')
#: Datetime the build was created
self.created_at = self._strptime(build.get('created_at'))
#: Datetime the build was updated
self.updated_at = self._strptime(build.get('updated_at'))
def _repr(self):
return '<Pages Build [{0}/{1}]>'.format(self.commit, self.status)