#NEWLINE# def _gen_children( self ) : #NEWLINE# #INDENT# src = '    def children(self):\n' #NEWLINE# if self . all_entries : #NEWLINE# #INDENT# src += '        nodelist = []\n' #NEWLINE# for child in self . child : #NEWLINE# #INDENT# src += ( ( '        if self.%(child)s is not None:' + ' nodelist.append(("%(child)s", self.%(child)s))\n' ) % dict ( child = child ) ) #NEWLINE# #UNINDENT# for seq_child in self . seq_child : #NEWLINE# #INDENT# src += ( '        for i, child in enumerate(self.%(child)s or []):\n            nodelist.append(("%(child)s[%%d]" %% i, child))\n' % dict ( child = seq_child ) ) #NEWLINE# #UNINDENT# src += '        return tuple(nodelist)\n' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# src += '        return ()\n' #NEWLINE# #UNINDENT# return src