add kwargs support for notifications
authorFelix Domke <tmbinc@elitedvb.net>
Wed, 10 May 2006 23:02:07 +0000 (23:02 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Wed, 10 May 2006 23:02:07 +0000 (23:02 +0000)
lib/python/Screens/InfoBarGenerics.py
lib/python/Tools/Notifications.py

index d152007..2bae429 100644 (file)
@@ -1365,9 +1365,9 @@ class InfoBarNotifications:
                        print "open",n
                        cb = n[0]
                        if cb is not None:
-                               self.session.openWithCallback(cb, *n[1:])
+                               self.session.openWithCallback(cb, n[1], *n[2], **n[3])
                        else:
-                               self.session.open(*n[1:])
+                               self.session.open(n[1], *n[2], **n[3])
 
 class InfoBarServiceNotifications:
        def __init__(self):
index b547639..3cb107c 100644 (file)
@@ -3,11 +3,10 @@ notifications = [ ]
 
 notificationAdded = [ ]
 
-def AddNotification(screen, *args):
-       AddNotificationWithCallback(None, screen, *args)
+def AddNotification(screen, *args, **kwargs):
+       AddNotificationWithCallback(None, screen, *args, **kwargs)
 
-def AddNotificationWithCallback(fnc, screen, *args):
-       notifications.append((fnc, screen) + args)
+def AddNotificationWithCallback(fnc, screen, *args, **kwargs):
+       notifications.append((fnc, screen, args, kwargs))
        for x in notificationAdded:
                x()
-