aboutsummaryrefslogtreecommitdiffstats
path: root/local/handler/IssueHandler.py
blob: d64f330bc59d4c7afada66d13185dec308bc1ab9 (plain) (blame)
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
from ..utility import *

def handle(data, theme):
    if 'issue' in data:
        issue = data['issue']
        type = 'issue'
    elif 'pull_request' in data:
        issue = data['pull_request']
        type = 'pull request'
    else:
        type = 'something'

    if data['action'] == 'edited' and not configValue("showIssueEdits"):
        return

    milestone = ''
    if issue['milestone'] and configValue("showMilestone"):
        milestone = issue['milestone']['title']

    assignee = ''
    if 'assignee' in data and data['assignee']:
        assignee = data['assignee']['login']
    elif 'assignee' in issue and issue['assignee']:
        assignee = issue['assignee']['login']

    labelName = None
    labelColor = None
    if 'label' in data and data['label']:
        labelName = data['label']['name']
        labelColor = data['label']['color']

    theme.issue(
        actor = data['sender']['login'],
        action = data['action'],
        issueNo = issue['number'],
        issueTitle = issue['title'],
        creator = issue['user']['login'],
        milestone = milestone,
        url = getShortURL(issue['html_url']),
        assignee = assignee,
        labelName = labelName,
        labelColor = labelColor,
        type = type
    )

© 2014-2024 Faster IT GmbH | imprint | privacy policy