<s> from . base import Factory <EOL> from . childrentree import ChildrenTree <EOL> class DictFactoryBuilder ( type ) : <EOL> """<STR_LIT>""" <EOL> def __new__ ( meta , name , bases , dct ) : <EOL> _child_factory_tree = ChildrenTree ( ) <EOL> _child_factory_tree . load_bases ( bases ) <EOL> _child_factory_tree . update ( dct ) <EOL> DictFactoryBuilder . _clean_factories ( dct ) <EOL> dct [ "<STR_LIT>" ] = _child_factory_tree <EOL> return super ( DictFactoryBuilder , meta ) . __new__ ( meta , name , bases , dct ) <EOL> @ staticmethod <EOL> def _clean_factories ( dct ) : <EOL> """<STR_LIT>""" <EOL> for key in dct . keys ( ) : <EOL> if issubclass ( type ( dct [ key ] ) , Factory ) : <EOL> dct . pop ( key ) </s>
