#NEWLINE# def hasChild( self , childPath ) : #NEWLINE# #INDENT# 'Return True if child exists in data.' #NEWLINE# if ( type ( self . data ) == type ( dict ( ) ) ) : #NEWLINE# #INDENT# nodes = childPath . split ( '/' ) #NEWLINE# child = self . data #NEWLINE# for node in nodes : #NEWLINE# #INDENT# if node : #NEWLINE# #INDENT# if ( node == nodes [ ( - 1 ) : ] ) : #NEWLINE# #INDENT# return ( node in child ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# child = child [ node ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return False