Skip to content

Commit

Permalink
Add alternative PR title display
Browse files Browse the repository at this point in the history
  • Loading branch information
ye11ow committed Jan 28, 2020
1 parent 9486d40 commit 5aad269
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion noti.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def __init__(self, project, mr):
self._project = project
self._mr = mr

@property
def title(self):
return self._mr.attributes.get('title')

@property
def ci_status(self):
pipeline = self._mr.attributes.get('pipeline')
Expand Down Expand Up @@ -191,6 +195,10 @@ def __init__(self, repo, pr):
self._repo = repo
self._pr = pr

@property
def title(self):
return self._pr.title

@property
def ci_status(self):
if not hasattr(self, '_status'):
Expand Down Expand Up @@ -263,6 +271,7 @@ def author(self):
@property
def created_at(self):
return self._comment.created_at.replace(tzinfo=tzutc()).astimezone(tzlocal())

@property
def body(self):
return self._comment.body
Expand Down Expand Up @@ -326,6 +335,7 @@ def print_mr(self, mr):
title = f"{mr.branch} 💬{len(mr.reviews)} {title}"

print(f"{title}\n\n\n{sub_text}")
print(f"{mr.title} | alternate=true")

def print_title(self, mrs):
statistics = {
Expand Down Expand Up @@ -407,4 +417,4 @@ def time_diff(self, before):
bp.print_title(mrs)
for mr in mrs:
bp.print_mr(mr)
bp.print_config()
bp.print_config()

0 comments on commit 5aad269

Please sign in to comment.