[pygccxml-commit] source/pyplusplus/module_creator creator.py,1.61,1.62
Brought to you by:
mbaas,
roman_yakovenko
From: Roman <rom...@us...> - 2006-03-19 05:45:17
|
Update of /cvsroot/pygccxml/source/pyplusplus/module_creator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13809/pyplusplus/module_creator Modified Files: creator.py Log Message: adding support to user text/code on decl_wrappers.class_t class Index: creator.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/module_creator/creator.py,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** creator.py 10 Mar 2006 10:57:31 -0000 1.61 --- creator.py 19 Mar 2006 05:45:14 -0000 1.62 *************** *** 228,231 **** --- 228,240 ---- def _is_wrapper_needed(self, exportable_members): + if isinstance( self.__curr_decl, declarations.class_t ) \ + and self.__curr_decl.wrapper_user_code: + return True + elif isinstance( self.__curr_parent, declarations.class_t ) \ + and self.__curr_parent.wrapper_user_code: + return True + else: + pass + for member in exportable_members: if isinstance( member, declarations.destructor_t ): *************** *** 308,311 **** --- 317,334 ---- registrators_db.append(r) + def _append_user_code( self ): + ctext_t = code_creators.custom_text_t + for creator in code_creators.make_flatten( self.__extmodule ): + if isinstance( creator, code_creators.class_t ): + for user_code in creator.declaration.user_code: + creator.adopt_creator( + ctext_t( user_code.text + , works_on_instance=user_code.works_on_instance ) ) + elif isinstance( creator, code_creators.class_wrapper_t ): + for user_code in creator.declaration.wrapper_user_code: + creator.adopt_creator( ctext_t( user_code.text ) ) + else: + pass + def create(self, decl_headers=None): """Create and return the module for the extension. *************** *** 330,333 **** --- 353,358 ---- for creator in code_creators.make_flatten( self.__extmodule ): creator.target_configuration = self.__target_configuration + #last action. + self._append_user_code() return self.__extmodule |