#NEWLINE# def buildSubMenu( self , parent , logger ) : #NEWLINE# #INDENT# self . buildLevelMenu ( parent , logger ) #NEWLINE# pymel . menuItem ( d = 1 , p = parent ) #NEWLINE# try : #NEWLINE# #INDENT# if logger . children : #NEWLINE# #INDENT# pymel . menuItem ( l = 'Child Loggers:' , p = parent , en = 0 ) #NEWLINE# for item in logger . children : #NEWLINE# #INDENT# subMenu = pymel . menuItem ( l = item . name , sm = True , p = parent , tearOff = True , aob = True , pmo = True ) #NEWLINE# subMenu . postMenuCommand ( pymel . Callback ( self . buildSubMenu , parent = subMenu , logger = item ) ) #NEWLINE# subMenu . setPostMenuCommandOnce ( True ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# pymel . menuItem ( d = 1 , p = parent ) #NEWLINE# if logger . handlers : #NEWLINE# #INDENT# pymel . menuItem ( l = 'Streams:' , p = parent , en = 0 ) #NEWLINE# for item in logger . handlers : #NEWLINE# #INDENT# levelsMenu = pymel . menuItem ( l = ( '%s <%s>' % ( item . __class__ . __name__ , levelsDict [ item . level ] ) ) , p = parent , sm = True , aob = True ) #NEWLINE# self . buildLevelMenu ( levelsMenu , item ) #NEWLINE# pymel . menuItem ( d = 1 , p = levelsMenu ) #NEWLINE# pymel . menuItem ( l = 'Set Formatter' , p = levelsMenu , c = pymel . Callback ( self . setFormatter , item ) ) #NEWLINE# pymel . menuItem ( l = 'Remove' , p = parent , ob = True , c = pymel . Callback ( logger . removeHandler , item ) ) #NEWLINE# #UNINDENT# #UNINDENT# pymel . menuItem ( l = '<New Stream...>' , p = parent , c = ( lambda * x : self . addHandler ( logger ) ) )