Author: croberts
Date: 2012-02-23 20:09:59 +0000 (Thu, 23 Feb 2012)
New Revision: 5225
Modified:
trunk/cumin/bin/cumin-web
trunk/cumin/etc/cumin.conf
trunk/cumin/python/cumin/config.py
trunk/cumin/python/cumin/widgets.py
Log:
Addressing BZ 750196 by adding an optional config entry for the number of seconds before a
notification in the yellow banner will exist before being dismissed. The default value is
180 seocnds (3 minutes).
Modified: trunk/cumin/bin/cumin-web
===================================================================
--- trunk/cumin/bin/cumin-web 2012-02-21 19:42:04 UTC (rev 5224)
+++ trunk/cumin/bin/cumin-web 2012-02-23 20:09:59 UTC (rev 5225)
@@ -139,6 +139,8 @@
cumin.user = values.user
cumin.update_interval = values.update_interval
cumin.max_qmf_table_sort = values.max_qmf_table_sort
+
+ cumin.notification_timeout = values.notification_timeout
cumin.fast_view_attributes = [x.strip() for x in
values.fast_view_attributes.split(',')]
Modified: trunk/cumin/etc/cumin.conf
===================================================================
--- trunk/cumin/etc/cumin.conf 2012-02-21 19:42:04 UTC (rev 5224)
+++ trunk/cumin/etc/cumin.conf 2012-02-23 20:09:59 UTC (rev 5225)
@@ -96,6 +96,10 @@
# max-qmf-table-sort: 1000
# persona: default
+#notification-timeout: 180
+# Number of seconds that a message in the yellow notification banner
+# will exist before being automatically dismissed. Default is 180 seconds
+
[data]
# log-file: $CUMIN_HOME/log/data.log
# expire-enabled: True
Modified: trunk/cumin/python/cumin/config.py
===================================================================
--- trunk/cumin/python/cumin/config.py 2012-02-21 19:42:04 UTC (rev 5224)
+++ trunk/cumin/python/cumin/config.py 2012-02-23 20:09:59 UTC (rev 5225)
@@ -54,6 +54,9 @@
param = ConfigParameter(web, "fast-view-attributes", str)
param.default =
"JobStatus,Cmd,Args,ExitStatus,JobStartDate,LastRemoteHost,LastJobStatus,Owner"
+
+ param = ConfigParameter(web, "notification-timeout", int)
+ param.default = 180
def create_data_section(self, name, strict_section):
data = CuminConfigSection(self, name, strict_section)
@@ -175,7 +178,7 @@
param = ConfigParameter(self, "aviary-domain-verify", bool)
param.default = True
-
+
# Intended for development use, not the end user.
# Undocumented.
param = ConfigParameter(self, "aviary-suds-logs", bool)
Modified: trunk/cumin/python/cumin/widgets.py
===================================================================
--- trunk/cumin/python/cumin/widgets.py 2012-02-21 19:42:04 UTC (rev 5224)
+++ trunk/cumin/python/cumin/widgets.py 2012-02-23 20:09:59 UTC (rev 5225)
@@ -14,7 +14,6 @@
from task import *
from user import *
from util import *
-
import time
from wooly import Session
@@ -1217,7 +1216,14 @@
self.add_child(self.item_widget)
def get_items(self, session):
- items = [x for x in session.get_notifications() if not x.dismissed]
+ 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
+ items = [x for x in items if not x.dismissed]
return items
def do_process(self, session):
Show replies by thread