-
-
Notifications
You must be signed in to change notification settings - Fork 122
/
Issue.py
30 lines (28 loc) · 1.23 KB
/
Issue.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
class Issue(object):
"""Basic Issue model for collecting the necessary info to send to GitHub."""
def __init__(self, title, labels, assignees, milestone, body, hunk, file_name,
start_line, num_lines, prefix, markdown_language, status, identifier, identifier_actual, ref, issue_url, issue_number, start_line_within_hunk=1):
self.title = title
self.labels = labels
self.assignees = assignees
self.milestone = milestone
self.body = body
self.hunk = hunk
self.file_name = file_name
self.start_line = start_line
self.num_lines = num_lines
self.prefix = prefix
self.markdown_language = markdown_language
self.status = status
self.identifier = identifier
self.identifier_actual = identifier_actual
self.ref = ref
self.issue_url = issue_url
self.issue_number = issue_number
self.start_line_within_hunk = start_line_within_hunk
def __str__(self):
selflist = []
for key in [x for x in vars(self).keys() if x not in ("hunk")]:
selflist.append(f'"{key}": "{getattr(self, key)}"')
selflist.append((f'"hunk": "{self.hunk}"'))
return '\n'.join(selflist)