[rhmessaging-commits] rhmessaging commits: r3042 - mgmt/trunk/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Jan 14 17:01:54 EST 2009


Author: justi9
Date: 2009-01-14 17:01:54 -0500 (Wed, 14 Jan 2009)
New Revision: 3042

Modified:
   mgmt/trunk/cumin/python/cumin/model.py
Log:
Add date ad properties for timestamp job attrs

Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py	2009-01-14 20:01:04 UTC (rev 3041)
+++ mgmt/trunk/cumin/python/cumin/model.py	2009-01-14 22:01:54 UTC (rev 3042)
@@ -193,6 +193,17 @@
     def get_ad_groups(cls):
         return cls.groups
 
+class DateAdProperty(AdProperty):
+    def __init__(self, cls, name):
+        super(DateAdProperty, self).__init__(cls, name)
+
+        self.renderer = self.render_datetime
+        self.group = "Other"
+
+    def render_datetime(self, session, value):
+        value = datetime.fromtimestamp(int(value))
+        return fmt_datetime(value)
+
 class CuminAction(object):
     def __init__(self, cls, name):
         self.model = cls.model
@@ -2358,13 +2369,35 @@
         prop.title = "Cluster ID"
         prop.writable = False
         
-        prop = self.DateAdProperty(self, "QDate")
+        prop = DateAdProperty(self, "QDate")
         prop.description = "When the job was submitted"
-        prop.group = "Other"
-        prop.renderer = prop.render_datetime
-        prop.title = "QDate"
         prop.writable = False
+
+        prop = DateAdProperty(self, "JobStartDate")
+        prop.group = "Main"
+        prop.writable = False
         
+        prop = DateAdProperty(self, "JobCurrentStartDate")
+        prop.writable = False
+        
+        prop = DateAdProperty(self, "LastSuspensionTime")
+        prop.writable = False
+        
+        prop = DateAdProperty(self, "ShadowBday")
+        prop.writable = False
+        
+        prop = DateAdProperty(self, "LastJobLeaseRenewal")
+        prop.writable = False
+        
+        prop = DateAdProperty(self, "EnteredCurrentStatus")
+        prop.writable = False
+        
+        prop = DateAdProperty(self, "CommittedTime")
+        prop.writable = False
+        
+        prop = DateAdProperty(self, "LastMatchTime")
+        prop.writable = False
+        
         ######## Properties
         prop = self.GroupProperty(self, "CustomGroup")
         prop.title = "Job Group"
@@ -2460,14 +2493,6 @@
     def get_icon_href(self, session):
         return "resource?name=job-36.png"
 
-    class DateAdProperty(AdProperty):
-        def render_datetime(self, session, value):
-            # XXX
-            if type(value) is unicode:
-                return value
-
-            return fmt_datetime(value)
-    
     class JobStatusProperty(AdProperty):
         def render_status(self, session, status):
             return JobStatusInfo.get_status_string(status)            




More information about the rhmessaging-commits mailing list