Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Catkin should send out only one notification #358

Merged
merged 4 commits into from
Apr 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions catkin_tools/execution/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,18 +359,21 @@ def print_exec_summary(self, completed_jobs, warned_jobs, failed_jobs):
def print_compact_summary(self, completed_jobs, warned_jobs, failed_jobs):
"""Print a compact build summary."""

notification_title = ""
notification_msg = []
# Print error summary
if len(completed_jobs) == len(self.jobs) and all(completed_jobs.items()) and len(failed_jobs) == 0:
if self.show_notifications:
notify("{} Succeded".format(self.label.capitalize()),
"{} {} completed with no warnings.".format(
len(completed_jobs), self.jobs_label))
notification_title = "{} Succeded".format(self.label.capitalize())
notification_msg.append("All {} {} succeeded!".format(len(self.jobs), self.jobs_label))

wide_log(clr('[{}] Summary: All {} {} succeeded!').format(
self.label,
len(self.jobs),
self.jobs_label))
else:
notification_msg.append("{} of {} {} succeeded.".format(
len([succeeded for jid, succeeded in completed_jobs.items() if succeeded]),
len(self.jobs), self.jobs_label))
wide_log(clr('[{}] Summary: {} of {} {} succeeded.').format(
self.label,
len([succeeded for jid, succeeded in completed_jobs.items() if succeeded]),
Expand All @@ -383,6 +386,7 @@ def print_compact_summary(self, completed_jobs, warned_jobs, failed_jobs):
wide_log(clr('[{}] Ignored: None.').format(
self.label))
else:
notification_msg.append("{} {} were skipped.".format(len(all_ignored_jobs), self.jobs_label))
wide_log(clr('[{}] Ignored: {} {} were skipped or are blacklisted.').format(
self.label,
len(all_ignored_jobs),
Expand All @@ -393,10 +397,8 @@ def print_compact_summary(self, completed_jobs, warned_jobs, failed_jobs):
wide_log(clr('[{}] Warnings: None.').format(
self.label))
else:
if self.show_notifications:
notify("{} Produced Warnings".format(self.label.capitalize()),
"{} {} succeeded with warnings.".format(
len(warned_jobs), self.jobs_label))
notification_title = "{} Succeded with Warnings".format(self.label.capitalize())
notification_msg.append("{} {} succeeded with warnings.".format(len(warned_jobs), self.jobs_label))

wide_log(clr('[{}] Warnings: {} {} succeeded with warnings.').format(
self.label,
Expand All @@ -410,10 +412,8 @@ def print_compact_summary(self, completed_jobs, warned_jobs, failed_jobs):
self.label,
self.jobs_label))
else:
if self.show_notifications:
notify("{} Incomplete".format(self.label.capitalize()),
"{} {} were abandoned.".format(
len(all_abandoned_jobs), self.jobs_label), icon_image='catkin_icon_red.png')
notification_title = "{} Incomplete".format(self.label.capitalize())
notification_msg.append("{} {} were abandoned.".format(len(all_abandoned_jobs), self.jobs_label))

wide_log(clr('[{}] Abandoned: {} {} were abandoned.').format(
self.label,
Expand All @@ -426,16 +426,22 @@ def print_compact_summary(self, completed_jobs, warned_jobs, failed_jobs):
self.label,
self.jobs_label))
else:
if self.show_notifications:
notify("{} Failed".format(self.label.capitalize()),
"{} {} failed.".format(
len(failed_jobs), self.jobs_label), icon_image='catkin_icon_red.png')
notification_title = "{} Failed".format(self.label.capitalize())
notification_msg.append("{} {} failed.".format(len(failed_jobs), self.jobs_label))

wide_log(clr('[{}] Failed: {} {} failed.').format(
self.label,
len(failed_jobs),
self.jobs_label))

if self.show_notifications:
if len(failed_jobs) != 0:
notify(notification_title, "\n".join(notification_msg), icon_image='catkin_icon_red.png')
elif len(warned_jobs) != 0:
notify(notification_title, "\n".join(notification_msg), icon_image='catkin_icon_yellow.png')
else:
notify(notification_title, "\n".join(notification_msg))

def run(self):
queued_jobs = []
active_jobs = []
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.