From c6c67aad39f01de092f567be5735ac016b935550 Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Fri, 6 Dec 2019 14:28:37 -0600 Subject: [PATCH] Added group to group together notifications --- ctabus/internal/notification.py | 5 ++++- ctabus/ui/notification.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ctabus/internal/notification.py b/ctabus/internal/notification.py index 70a8617..cdc0fd4 100755 --- a/ctabus/internal/notification.py +++ b/ctabus/internal/notification.py @@ -19,9 +19,10 @@ class NotificationException(Exception): class NotificationManager: - def __init__(self, workdir=state_dir): + def __init__(self, workdir=state_dir, group=None): self.workdir = workdir self.id = uuid.uuid4().hex + self.group = group self.title = None self.message = None @@ -93,6 +94,8 @@ class NotificationManager: ) ), ] + if self.group is not None: + cmdline.extend(["--group", str(self.group)]) message = self.message if self.message is not None else "Placeholder" title = self.title if self.title is not None else "Placeholder" diff --git a/ctabus/ui/notification.py b/ctabus/ui/notification.py index 9f7427e..8a7ada6 100644 --- a/ctabus/ui/notification.py +++ b/ctabus/ui/notification.py @@ -4,7 +4,7 @@ from ctabus.internal.notification import NotificationManager, HAS_NOTIFICATION class CTABUSNotifictaionManager(NotificationManager): def __init__(self, workdir=state_dir): - super().__init__(workdir) + super().__init__(workdir, group="ctabus") self.exiter = None def setup_exiter(self, exiter):