Author: croberts
Date: 2012-02-23 20:21:39 +0000 (Thu, 23 Feb 2012)
New Revision: 5226
Modified:
trunk/cumin/etc/cumin.conf
trunk/cumin/python/cumin/widgets.py
Log:
Addressing BZ 750196 again by adding a case for a value of 0 (or less) to cause the
messages to never timeout (which was the original cumin behavior).
Modified: trunk/cumin/etc/cumin.conf
===================================================================
--- trunk/cumin/etc/cumin.conf 2012-02-23 20:09:59 UTC (rev 5225)
+++ trunk/cumin/etc/cumin.conf 2012-02-23 20:21:39 UTC (rev 5226)
@@ -98,7 +98,8 @@
#notification-timeout: 180
# Number of seconds that a message in the yellow notification banner
-# will exist before being automatically dismissed. Default is 180 seconds
+# will exist before being automatically dismissed. Default is 180 seconds.
+# A value of 0 will cause the messages to never timeout
[data]
# log-file: $CUMIN_HOME/log/data.log
Modified: trunk/cumin/python/cumin/widgets.py
===================================================================
--- trunk/cumin/python/cumin/widgets.py 2012-02-23 20:09:59 UTC (rev 5225)
+++ trunk/cumin/python/cumin/widgets.py 2012-02-23 20:21:39 UTC (rev 5226)
@@ -1217,12 +1217,13 @@
def get_items(self, session):
items = session.get_notifications()
- for i in items:
- # we want the messages to timeout after 3 min, the easiest way is to dismiss
it
- # doing it here for now so that both TaskInvocations and Notifications will
be handled in the same place.
- # The value for the timeout can be changed via the notification-timeout
config
- if not i.dismissed and datetime.now() - i.timestamp >=
timedelta(seconds=self.app.notification_timeout):
- i.dismissed = True
+ if self.app.notification_timeout > 0:
+ for i in items:
+ # we want the messages to timeout after 3 min, the easiest way is to
dismiss it
+ # doing it here for now so that both TaskInvocations and Notifications
will be handled in the same place.
+ # The value for the timeout can be changed via the notification-timeout
config
+ if not i.dismissed and datetime.now() - i.timestamp >=
timedelta(seconds=self.app.notification_timeout):
+ i.dismissed = True
items = [x for x in items if not x.dismissed]
return items
Show replies by date