-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjob.py
38 lines (28 loc) · 993 Bytes
/
job.py
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
# -*- coding: utf-8 -*-
import github
class Job():
"""Class defining a complete Job which normally includes clone, build, flash
and run tests on a device."""
def __init__(self, payload, user_initiated=False):
self.payload = payload
self.user_initiated = user_initiated
def __str__(self):
return "{}-{}:{}/{}".format(
self.pr_id(),
self.pr_sha1(),
self.pr_full_name(),
self.pr_number())
def pr_number(self):
return github.pr_number(self.payload)
def pr_id(self):
return github.pr_id(self.payload)
def pr_name(self):
return github.pr_name(self.payload)
def pr_full_name(self):
return github.pr_full_name(self.payload)
def pr_sha1(self):
return github.pr_sha1(self.payload)
def pr_clone_url(self):
return github.pr_clone_url(self.payload)
def pr_branch(self):
return github.pr_branch(self.payload)