#NEWLINE# def update( self , s ) : #NEWLINE# #INDENT# self . win . erase ( ) #NEWLINE# if s . unavailable : #NEWLINE# #INDENT# self . session_counts [ s . server_id ] = 0 #NEWLINE# self . node_counts [ s . server_id ] = 0 #NEWLINE# self . zxids [ self . server_id ] = 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . session_counts [ s . server_id ] = len ( s . sessions ) #NEWLINE# self . node_counts [ s . server_id ] = int ( s . node_count ) #NEWLINE# self . zxids [ s . server_id ] = long ( s . zxid , 16 ) #NEWLINE# #UNINDENT# nc = max ( self . node_counts ) #NEWLINE# zxid = max ( self . zxids ) #NEWLINE# sc = sum ( self . session_counts ) #NEWLINE# self . addstr ( 0 , 0 , ( 'Ensemble -- nodecount:%d zxid:0x%x sessions:%d' % ( nc , zxid , sc ) ) )