4343COLUMN_COMMENT = 1
4444COLUMN_EAT = 2
4545COLUMN_MAXRSS = 13
46-
4746FONT_BOLD = QtGui .QFont ("Luxi Sans" , - 1 , QtGui .QFont .Bold )
47+ UPDATE_INTERVAL = 22
4848
4949
5050def getEta (stats ):
@@ -66,7 +66,7 @@ def __init__(self, parent):
6666
6767 self .startColumnsForType (cuegui .Constants .TYPE_JOB )
6868 self .addColumn ("Job" , 550 , id = 1 ,
69- data = lambda job :( job .data .name ) ,
69+ data = lambda job : job .data .name ,
7070 tip = "The name of the job: show-shot-user_uniqueName\n \n "
7171 "The color behind the job will change to:\n "
7272 "Blue \t if it is paused\n "
@@ -75,64 +75,64 @@ def __init__(self, parent):
7575 "Purple \t if all remaining frames depend on something\n "
7676 "Yellow \t if the maxRss is over %sKb" % cuegui .Constants .MEMORY_WARNING_LEVEL )
7777 self .addColumn ("_Comment" , 20 , id = 2 ,
78- sort = lambda job :( job .data .has_comment ) ,
78+ sort = lambda job : job .data .has_comment ,
7979 tip = "A comment icon will appear if a job has a comment. You\n "
8080 "may click on it to view the comments." )
8181 self .addColumn ("_Autoeat" , 20 , id = 3 ,
82- sort = lambda job :( job .data .auto_eat ) ,
82+ sort = lambda job : job .data .auto_eat ,
8383 tip = "If the job has auto eating enabled, a pac-man icon\n "
8484 "will appear here and all frames that become dead will\n "
8585 "automatically be eaten." )
8686 self .addColumn ("Run" , 38 , id = 3 ,
87- data = lambda job :( job .stats . running_frames ) ,
88- sort = lambda job :( job .stats . running_frames ) ,
87+ data = lambda job : job .data . job_stats . running_frames ,
88+ sort = lambda job : job .data . job_stats . running_frames ,
8989 tip = "The number of running frames." )
9090 self .addColumn ("Cores" , 55 , id = 4 ,
91- data = lambda job :( "%.02f" % job .stats . reserved_cores ) ,
92- sort = lambda job :( job .stats . reserved_cores ) ,
91+ data = lambda job : "%.02f" % job .data . job_stats . reserved_cores ,
92+ sort = lambda job : job .data . job_stats . reserved_cores ,
9393 tip = "The number of reserved cores." )
9494 self .addColumn ("Wait" , 45 , id = 5 ,
95- data = lambda job :( job .stats . waiting_frames ) ,
96- sort = lambda job :( job .stats . waiting_frames ) ,
95+ data = lambda job : job .data . job_stats . waiting_frames ,
96+ sort = lambda job : job .data . job_stats . waiting_frames ,
9797 tip = "The number of waiting frames." )
9898 self .addColumn ("Depend" , 55 , id = 6 ,
99- data = lambda job :( job .stats . depend_frames ) ,
100- sort = lambda job :( job .stats . depend_frames ) ,
99+ data = lambda job : job .data . job_stats . depend_frames ,
100+ sort = lambda job : job .data . job_stats . depend_frames ,
101101 tip = "The number of dependent frames." )
102102 self .addColumn ("Total" , 50 , id = 7 ,
103- data = lambda job :( job .stats . total_frames ) ,
104- sort = lambda job :( job .stats . total_frames ) ,
103+ data = lambda job : job .data . job_stats . total_frames ,
104+ sort = lambda job : job .data . job_stats . total_frames ,
105105 tip = "The total number of frames." )
106106# self.addColumn("_Booking Bar", 150, id=8, default=False,
107107# delegate=JobBookingBarDelegate)
108108 self .addColumn ("Min" , 38 , id = 9 ,
109- data = lambda job :( "%.0f" % job .data .min_cores ) ,
110- sort = lambda job :( job .data .min_cores ) ,
109+ data = lambda job : "%.0f" % job .data .min_cores ,
110+ sort = lambda job : job .data .min_cores ,
111111 tip = "The minimum number of running cores that the cuebot\n "
112112 "will try to maintain." )
113113 self .addColumn ("Max" , 38 , id = 10 ,
114- data = lambda job :( "%.0f" % job .data .max_cores ) ,
115- sort = lambda job :( job .data .max_cores ) ,
114+ data = lambda job : "%.0f" % job .data .max_cores ,
115+ sort = lambda job : job .data .max_cores ,
116116 tip = "The maximum number of running cores that the cuebot\n "
117117 "will allow." )
118118 self .addColumn ("Age" , 50 , id = 11 ,
119- data = lambda job :( cuegui .Utils .secondsToHHHMM (time .time () - job .data .start_time ) ),
120- sort = lambda job :( time .time () - job .data .start_time ) ,
119+ data = lambda job : cuegui .Utils .secondsToHHHMM (time .time () - job .data .start_time ),
120+ sort = lambda job : time .time () - job .data .start_time ,
121121 tip = "The HOURS:MINUTES since the job was launched." )
122122 self .addColumn ("Pri" , 30 , id = 12 ,
123- data = lambda job :( job .data .priority ) ,
124- sort = lambda job :( job .data .priority ) ,
123+ data = lambda job : job .data .priority ,
124+ sort = lambda job : job .data .priority ,
125125 tip = "The job priority. The cuebot uses this as a suggestion\n "
126126 "to determine what job needs the next available matching\n "
127127 "resource." )
128128 self .addColumn ("ETA" , 65 , id = 13 ,
129- data = lambda job :( "" ) ,
129+ data = lambda job : "" ,
130130 tip = "(Inacurate and disabled until a better solution exists)\n "
131131 "A very rough estimate of the number of HOURS:MINUTES\n "
132132 "it will be before the entire job is done." )
133133 self .addColumn ("MaxRss" , 60 , id = 14 ,
134- data = lambda job :( cuegui .Utils .memoryToString (job .stats . maxRss ) ),
135- sort = lambda job :( job .stats . maxRss ) ,
134+ data = lambda job : cuegui .Utils .memoryToString (job .data . job_stats . max_rss ),
135+ sort = lambda job : job .data . job_stats . max_rss ,
136136 tip = "The most memory used at one time by any single frame." )
137137 self .addColumn ("_Blank" , 20 , id = 15 ,
138138 tip = "Spacer" )
@@ -190,7 +190,7 @@ def __init__(self, parent):
190190 # Skip updates if the user is scrolling
191191 self ._limitUpdatesDuringScrollSetup ()
192192
193- self .setUpdateInterval (22 )
193+ self .setUpdateInterval (UPDATE_INTERVAL )
194194
195195 def __itemSingleClickedCopy (self , item , col ):
196196 """Called when an item is clicked on. Copies selected object names to
@@ -360,8 +360,8 @@ def _processUpdate(self, work, results):
360360 """Adds or updates jobs and groups. Removes those that do not get updated
361361 @type work: from threadpool
362362 @param work: from threadpool
363- @type nested_shows : [list<NestedGroup>, set(str)]
364- @param nested_shows : List that contains updated nested groups and a set
363+ @type results : [list<NestedGroup>, set(str)]
364+ @param results : List that contains updated nested groups and a set
365365 of all updated item ids"""
366366 if results is None :
367367 return
@@ -394,6 +394,8 @@ def _processUpdate(self, work, results):
394394 # Only updates
395395 self .__processUpdateHandleNested (self .invisibleRootItem (), results [0 ])
396396 self .redraw ()
397+ except Exception :
398+ logger .warning ("Failed to process update." , exc_info = True )
397399 finally :
398400 self ._itemsLock .unlock ()
399401
@@ -447,7 +449,8 @@ def __processUpdateHandleNested(self, parent, groups):
447449 self .__processUpdateHandleNested (groupItem , group .groups )
448450
449451 # If group has jobs, update them
450- jobs = group .jobs
452+ groupWrapper = opencue .api .getGroup (group .id )
453+ jobs = groupWrapper .getJobs ()
451454 if hasattr (jobs , 'nested_jobs' ):
452455 jobs = jobs .nested_jobs
453456 for job in jobs :
@@ -715,17 +718,17 @@ def data(self, col, role):
715718
716719 elif role == QtCore .Qt .BackgroundRole :
717720 if col == COLUMN_MAXRSS and \
718- self .rpcObject .job_stats .max_rss > cuegui .Constants .MEMORY_WARNING_LEVEL :
721+ self .rpcObject .data . job_stats .max_rss > cuegui .Constants .MEMORY_WARNING_LEVEL :
719722 return self .__highMemoryColor
720723 if self .rpcObject .data .is_paused :
721724 return self .__pausedColor
722- if self .rpcObject .stats .dead_frames :
725+ if self .rpcObject .data . job_stats .dead_frames :
723726 return self .__dyingColor
724- if not self .rpcObject .job_stats .running_frames :
725- if not self .rpcObject .job_stats .waiting_frames and \
726- self .rpcObject .job_stats .depend_frames :
727+ if not self .rpcObject .data . job_stats .running_frames :
728+ if not self .rpcObject .data . job_stats .waiting_frames and \
729+ self .rpcObject .data . job_stats .depend_frames :
727730 return self .__dependedColor
728- if self .rpcObject .job_stats .waiting_frames and \
731+ if self .rpcObject .data . job_stats .waiting_frames and \
729732 time .time () - self .rpcObject .data .start_time > 30 :
730733 return self .__noRunningColor
731734 return self .__backgroundColor
@@ -742,13 +745,13 @@ def data(self, col, role):
742745 elif role == QtCore .Qt .UserRole + 1 :
743746 if "FST" not in self ._cache :
744747 self ._cache ["FST" ] = {
745- FrameState .Dead : self .rpcObject .job_stats .dead_frames ,
746- FrameState .Depend : self .rpcObject .job_stats .depend_frames ,
747- FrameState .Eaten : self .rpcObject .job_stats .eaten_frames ,
748- FrameState .Running : self .rpcObject .job_stats .running_frames ,
748+ FrameState .Dead : self .rpcObject .data . job_stats .dead_frames ,
749+ FrameState .Depend : self .rpcObject .data . job_stats .depend_frames ,
750+ FrameState .Eaten : self .rpcObject .data . job_stats .eaten_frames ,
751+ FrameState .Running : self .rpcObject .data . job_stats .running_frames ,
749752 FrameState .Setup : 0 ,
750- FrameState .Succeeded : self .rpcObject .job_stats .succeeded_frames ,
751- FrameState .Waiting : self .rpcObject .job_stats .waiting_frames
753+ FrameState .Succeeded : self .rpcObject .data . job_stats .succeeded_frames ,
754+ FrameState .Waiting : self .rpcObject .data . job_stats .waiting_frames
752755 }
753756 return self ._cache .get ("FST" , cuegui .Constants .QVARIANT_NULL )
754757
0 commit comments