Browse Source

Added group to group together notifications

master
Raphael Roberts 6 years ago
parent
commit
c6c67aad39
  1. 5
      ctabus/internal/notification.py
  2. 2
      ctabus/ui/notification.py

5
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"

2
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):

Loading…
Cancel
Save