pygccxml-commit Mailing List for C++ Python language bindings (Page 83)
Brought to you by:
mbaas,
roman_yakovenko
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(190) |
Apr
(166) |
May
(170) |
Jun
(75) |
Jul
(105) |
Aug
(131) |
Sep
(99) |
Oct
(84) |
Nov
(67) |
Dec
(54) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(66) |
Feb
(49) |
Mar
(25) |
Apr
(62) |
May
(21) |
Jun
(34) |
Jul
(9) |
Aug
(21) |
Sep
(5) |
Oct
|
Nov
(63) |
Dec
(34) |
2008 |
Jan
(10) |
Feb
(42) |
Mar
(26) |
Apr
(25) |
May
(6) |
Jun
(40) |
Jul
(18) |
Aug
(29) |
Sep
(6) |
Oct
(32) |
Nov
(14) |
Dec
(56) |
2009 |
Jan
(127) |
Feb
(52) |
Mar
(2) |
Apr
(10) |
May
(29) |
Jun
(3) |
Jul
|
Aug
(16) |
Sep
(4) |
Oct
(11) |
Nov
(8) |
Dec
(14) |
2010 |
Jan
(31) |
Feb
(1) |
Mar
(7) |
Apr
(9) |
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(8) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Roman <rom...@us...> - 2006-03-20 05:48:01
|
Update of /cvsroot/pygccxml/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv516 Modified Files: pygccxml.e3p Log Message: removing finalize from the code_creators and adding it to decl wrappers Index: pygccxml.e3p =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml.e3p,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pygccxml.e3p 27 Oct 2005 05:39:15 -0000 1.9 --- pygccxml.e3p 20 Mar 2006 05:47:56 -0000 1.10 *************** *** 2,7 **** <!DOCTYPE Project SYSTEM "Project-3.5.dtd"> <!-- Project file for project pygccxml --> ! <!-- Saved: 2005-10-23, 20:38:34 --> ! <!-- Copyright (C) 2005 Roman Yakovenko, --> <Project version="3.5"> <Description></Description> --- 2,7 ---- <!DOCTYPE Project SYSTEM "Project-3.5.dtd"> <!-- Project file for project pygccxml --> ! <!-- Saved: 2006-03-17, 23:31:05 --> ! <!-- Copyright (C) 2006 Roman Yakovenko, --> <Project version="3.5"> <Description></Description> *************** *** 287,295 **** <Dir>pyplusplus</Dir> <Dir>code_creators</Dir> - <Name>call_policies.py</Name> - </Source> - <Source> - <Dir>pyplusplus</Dir> - <Dir>code_creators</Dir> <Name>calldef.py</Name> </Source> --- 287,290 ---- *************** *** 416,426 **** <Dir>examples</Dir> <Dir>py_date_time</Dir> - <Dir>docs</Dir> - <Name>generate_docs.py</Name> - </Source> - <Source> - <Dir>pyplusplus</Dir> - <Dir>examples</Dir> - <Dir>py_date_time</Dir> <Name>environment.py</Name> </Source> --- 411,414 ---- *************** *** 456,466 **** <Dir>pyplusplus</Dir> <Dir>examples</Dir> - <Dir>py_date_time</Dir> - <Dir>unittests</Dir> - <Name>tester.py</Name> - </Source> - <Source> - <Dir>pyplusplus</Dir> - <Dir>examples</Dir> <Dir>py_easybmp</Dir> <Name>create_easybmp.py</Name> --- 444,447 ---- *************** *** 476,486 **** <Dir>examples</Dir> <Dir>py_easybmp</Dir> - <Dir>docs</Dir> - <Name>generate_docs.py</Name> - </Source> - <Source> - <Dir>pyplusplus</Dir> - <Dir>examples</Dir> - <Dir>py_easybmp</Dir> <Name>environment.py</Name> </Source> --- 457,460 ---- *************** *** 489,498 **** <Dir>examples</Dir> <Dir>py_easybmp</Dir> - <Name>grayscale.py</Name> - </Source> - <Source> - <Dir>pyplusplus</Dir> - <Dir>examples</Dir> - <Dir>py_easybmp</Dir> <Dir>unittests</Dir> <Name>grayscale.py</Name> --- 463,466 ---- *************** *** 514,524 **** <Dir>examples</Dir> <Dir>py_qtxml</Dir> - <Dir>docs</Dir> - <Name>generate_docs.py</Name> - </Source> - <Source> - <Dir>pyplusplus</Dir> - <Dir>examples</Dir> - <Dir>py_qtxml</Dir> <Name>environment.py</Name> </Source> --- 482,485 ---- *************** *** 623,631 **** <Dir>pyplusplus</Dir> <Dir>unittests</Dir> - <Name>bpmodule_tester.py</Name> - </Source> - <Source> - <Dir>pyplusplus</Dir> - <Dir>unittests</Dir> <Name>call_policies_tester.py</Name> </Source> --- 584,587 ---- *************** *** 741,771 **** </Source> <Source> ! <Dir>pyppqt</Dir> ! <Name>create_qtcore.py</Name> </Source> <Source> ! <Dir>pyppqt</Dir> ! <Name>create_qtxml.py</Name> </Source> <Source> ! <Dir>pyppqt</Dir> <Name>environment.py</Name> </Source> <Source> ! <Dir>pyppqt</Dir> ! <Name>qtdemo.py</Name> </Source> <Source> ! <Name>release_builder.py</Name> </Source> <Source> ! <Name>setup_pygccxml.py</Name> </Source> <Source> ! <Name>setup_pyplusplus.py</Name> </Source> <Source> ! <Dir>www</Dir> ! <Name>generate_index.py</Name> </Source> </Sources> --- 697,1235 ---- </Source> <Source> ! <Name>release_builder.py</Name> </Source> <Source> ! <Name>setup_pygccxml.py</Name> </Source> <Source> ! <Name>setup_pyplusplus.py</Name> ! </Source> ! <Source> ! <Dir>www</Dir> ! <Name>generate_index.py</Name> ! </Source> ! <Source> ! <Name>maya-sdk.py</Name> ! </Source> ! <Source> ! <Name>query.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>declarations</Dir> ! <Name>call_invocation.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>declarations</Dir> ! <Name>decl_factory.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>declarations</Dir> ! <Name>decl_printer.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>declarations</Dir> ! <Name>filters.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>declarations</Dir> ! <Name>matcher.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>declarations</Dir> ! <Name>pattern_parser.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>docs</Dir> ! <Name>generate_reference_manual.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>docs</Dir> ! <Name>www_configuration.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>parser</Dir> ! <Name>directory_cache.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>parser</Dir> ! <Name>patcher.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>unittests</Dir> ! <Name>bit_fields_tester.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>unittests</Dir> ! <Name>cached_source_file_tester.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>unittests</Dir> ! <Name>cache_enums_tester.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>unittests</Dir> ! <Name>calldef_matcher_tester.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>unittests</Dir> ! <Name>call_invocation_tester.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>unittests</Dir> ! <Name>complex_types_tester.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>unittests</Dir> ! <Name>decl_printer_tester.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>unittests</Dir> ! <Name>filters_tester.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>unittests</Dir> ! <Name>namespace_matcher_tester.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>unittests</Dir> ! <Name>patcher_tester.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>unittests</Dir> ! <Name>variable_matcher_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>code_creators</Dir> ! <Name>array_1_registrator.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>code_creators</Dir> ! <Name>license.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>docs</Dir> ! <Name>www_configuration.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>py_date_time</Dir> ! <Dir>unittests</Dir> ! <Name>examples.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>py_date_time</Dir> ! <Dir>unittests</Dir> ! <Name>test_all.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>py_qtxml</Dir> ! <Name>www_configuration.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>gui</Dir> ! <Name>wizard.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>abstract_classes_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>class_order2_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>class_order3_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>class_order4_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>class_order_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>dwrapper_printer_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>index_operator_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>internal_classes_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>mdecl_wrapper_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>module_properties_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>noncopyable_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>optional_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>recursive_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>regression2_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>regression3_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>special_operators_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>temprorary_variable_tester.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>unittests</Dir> ! <Name>user_text_tester.py</Name> ! </Source> ! <Source> ! <Dir>pygccxml</Dir> ! <Dir>docs</Dir> ! <Dir>logos</Dir> ! <Name>www_configuration.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>code_repository</Dir> ! <Name>array_1.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>code_repository</Dir> ! <Name>__init__.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>algorithm.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>calldef_wrapper.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>call_policies.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>class_wrapper.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>decl_wrapper.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>decl_wrapper_printer.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>enumeration_wrapper.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>finalizable.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>mdecl_wrapper.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>namespace_wrapper.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>scopedef_wrapper.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>typedef_wrapper.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>variable_wrapper.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>__init__.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>decl_wrappers</Dir> ! <Name>user_text.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>docs</Dir> ! <Dir>comparisons</Dir> ! <Name>www_configuration.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>docs</Dir> ! <Dir>ConferenceIsrael2006</Dir> ! <Name>generate_docs.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>docs</Dir> ! <Dir>ConferenceIsrael2006</Dir> ! <Name>www_configuration.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>docs</Dir> ! <Dir>examples</Dir> ! <Dir>date_time</Dir> ! <Name>www_configuration.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>docs</Dir> ! <Dir>examples</Dir> ! <Dir>easybmp</Dir> ! <Name>www_configuration.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>docs</Dir> ! <Dir>examples</Dir> ! <Dir>qtxml</Dir> ! <Name>www_configuration.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>docs</Dir> ! <Dir>logos</Dir> ! <Name>www_configuration.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>custom_code_creator</Dir> ! <Name>create_bindings.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>custom_code_creator</Dir> <Name>environment.py</Name> </Source> <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>custom_code_creator</Dir> ! <Dir>unittests</Dir> ! <Name>test_all.py</Name> </Source> <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tnfox</Dir> ! <Name>aliases.py</Name> </Source> <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tnfox</Dir> ! <Name>call_policies.py</Name> </Source> <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tnfox</Dir> ! <Name>color_array.py</Name> </Source> <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tnfox</Dir> ! <Name>create_tnfox.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tnfox</Dir> ! <Name>customization_data.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tnfox</Dir> ! <Name>declarations_to_exclude.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tnfox</Dir> ! <Name>environment.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tnfox</Dir> ! <Name>files_to_exclude.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tnfox</Dir> ! <Name>profile_tnfox.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tutorials</Dir> ! <Name>advanced.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tutorials</Dir> ! <Name>environment.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>examples</Dir> ! <Dir>tutorials</Dir> ! <Name>simple.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>experimental</Dir> ! <Name>decltypes.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>experimental</Dir> ! <Name>declwrapper.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>experimental</Dir> ! <Name>filters.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>experimental</Dir> ! <Name>pypp_api.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>experimental</Dir> ! <Name>selection.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>experimental</Dir> ! <Name>treerange.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>experimental</Dir> ! <Name>__init__.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>experimental</Dir> ! <Dir>docs</Dir> ! <Name>generate_all_docs.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>module_builder</Dir> ! <Name>builder.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>module_builder</Dir> ! <Name>__init__.py</Name> ! </Source> ! <Source> ! <Dir>pyplusplus</Dir> ! <Dir>utils</Dir> ! <Name>__init__.py</Name> </Source> </Sources> |
Update of /cvsroot/pygccxml/source/pyplusplus/decl_wrappers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv516/pyplusplus/decl_wrappers Modified Files: calldef_wrapper.py class_wrapper.py decl_wrapper.py namespace_wrapper.py scopedef_wrapper.py Removed Files: finalizable.py Log Message: removing finalize from the code_creators and adding it to decl wrappers Index: scopedef_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/scopedef_wrapper.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scopedef_wrapper.py 19 Mar 2006 13:35:39 -0000 1.3 --- scopedef_wrapper.py 20 Mar 2006 05:47:56 -0000 1.4 *************** *** 5,13 **** import decl_wrapper - import finalizable from pygccxml import declarations import mdecl_wrapper ! class scopedef_t(decl_wrapper.decl_wrapper_t, finalizable.finalizable_t): RECURSIVE_DEFAULT = True --- 5,12 ---- import decl_wrapper from pygccxml import declarations import mdecl_wrapper ! class scopedef_t(decl_wrapper.decl_wrapper_t): RECURSIVE_DEFAULT = True *************** *** 15,19 **** def __init__(self): decl_wrapper.decl_wrapper_t.__init__( self ) - finalizable.finalizable_t.__init__( self ) def exclude( self ): --- 14,17 ---- *************** *** 25,34 **** map( lambda decl: decl.include(), self.declarations ) - def finalize( self ): - finalizables = filter( lambda decl: isinstance( decl, finalizable.finalizable_t ) - and decl.is_finalizable() - , declarations.make_flatten( self.declarations ) ) - map( lambda decl: decl.finalize(), finalizables ) - def __create_matcher( self, match_class, *args, **keywds ): if len( args ) == 1 and callable( args[0] ): --- 23,26 ---- Index: decl_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/decl_wrapper.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** decl_wrapper.py 19 Mar 2006 13:35:39 -0000 1.2 --- decl_wrapper.py 20 Mar 2006 05:47:56 -0000 1.3 *************** *** 14,17 **** --- 14,21 ---- __REPOTED_REPLACES.append( msg ) + class ERROR_BEHAVIOUR: + PRINT = 'print' + RAISE = 'raise' + class decl_wrapper_t(object): def __init__(self): *************** *** 54,56 **** --- 58,78 ---- def include( self ): self.ignore = False + + #I think that almost every declaration could have some wrapper. This is the + #main reason why those 3 functions does not have some well defined interface. + def has_wrapper( self ): + return False + + def _finalize_impl( self, error_behaviour ): + pass + + def finalize( self, error_behaviour=None): + try: + self._finalize_impl( self ) + except Exception, error: + if None is error_behaviour or error_behaviour == ERROR_BEHAVIOUR.PRINT: + print 'Unable to finalize declaration: ', str( error ) + else: + raise + \ No newline at end of file Index: namespace_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/namespace_wrapper.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** namespace_wrapper.py 15 Mar 2006 09:27:06 -0000 1.2 --- namespace_wrapper.py 20 Mar 2006 05:47:56 -0000 1.3 *************** *** 5,9 **** import scopedef_wrapper - import finalizable from pygccxml import declarations --- 5,8 ---- *************** *** 12,18 **** scopedef_wrapper.scopedef_t.__init__( self ) declarations.namespace_t.__init__(self, *arguments, **keywords ) - - def is_finalizable(self): - return True def namespace( self, *args, **keywds ): --- 11,14 ---- Index: class_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/class_wrapper.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** class_wrapper.py 19 Mar 2006 05:45:14 -0000 1.2 --- class_wrapper.py 20 Mar 2006 05:47:56 -0000 1.3 *************** *** 6,10 **** import decl_wrapper import scopedef_wrapper - import finalizable from pygccxml import declarations import user_text --- 6,9 ---- *************** *** 27,31 **** self._user_code = [] self._wrapper_user_code = [] - def _get_always_expose_using_scope( self ): --- 26,29 ---- *************** *** 59,68 **** wrapper_alias = property( _get_wrapper_alias, _set_wrapper_alias ) ! def is_finalizable(self): ! finalizables = filter( lambda decl: isinstance( decl, finalizable.finalizable_t ) ! , self.declarations ) ! temp = filter( lambda creator: creator.is_finalizable(), finalizables ) ! return len( temp ) == len( finalizables ) def _get_user_code( self ): return self._user_code --- 57,70 ---- wrapper_alias = property( _get_wrapper_alias, _set_wrapper_alias ) ! def has_wrapper( self ): ! for decl in self.declarations: ! if decl.has_wrapper(): ! return True ! return False + def _finalize_impl( self, error_behaviour ): + for decl in self.declarations: + decl.finalize( error_behaviour ) + def _get_user_code( self ): return self._user_code --- finalizable.py DELETED --- Index: calldef_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/calldef_wrapper.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** calldef_wrapper.py 5 Mar 2006 05:51:30 -0000 1.2 --- calldef_wrapper.py 20 Mar 2006 05:47:56 -0000 1.3 *************** *** 5,15 **** import decl_wrapper - import finalizable from pygccxml import declarations ! class calldef_t(decl_wrapper.decl_wrapper_t, finalizable.finalizable_t): def __init__(self, *arguments, **keywords): decl_wrapper.decl_wrapper_t.__init__( self, *arguments, **keywords ) - finalizable.finalizable_t.__init__( self ) self._call_policies = None --- 5,20 ---- import decl_wrapper from pygccxml import declarations ! ##May be in future I will enable this functionality again, right now it seems ! ##that this is useless ! ##def is_finalizable(self): ! ##if not self.wrapper: ! ##return False ! ##return self.declaration.virtuality != declarations.VIRTUALITY_TYPES.PURE_VIRTUAL ! ! class calldef_t(decl_wrapper.decl_wrapper_t): def __init__(self, *arguments, **keywords): decl_wrapper.decl_wrapper_t.__init__( self, *arguments, **keywords ) self._call_policies = None *************** *** 42,46 **** --- 47,70 ---- use_default_arguments = property( _get_use_default_arguments, _set_use_default_arguments ) + def has_wrapper( self ): + if not isinstance( self, declarations.member_calldef_t ): + return False + elif self.virtuality == declarations.VIRTUALITY_TYPES.PURE_VIRTUAL: + return True + elif self.access_type == declarations.ACCESS_TYPES.PROTECTED: + return True + else: + return False + def _finalize_impl( self, error_behaviour ): + if not isinstance( self, declarations.member_calldef_t ): + pass + elif self.virtuality == declarations.VIRTUALITY_TYPES.PURE_VIRTUAL: + raise RuntimeError( "In order to expose pure virtual function, you should allow to pyplusplus to create wrapper." ) + elif self.access_type == declarations.ACCESS_TYPES.PROTECTED: + self.ignore = True + else: + pass + class member_function_t( declarations.member_function_t, calldef_t ): def __init__(self, *arguments, **keywords): |
From: Roman <rom...@us...> - 2006-03-20 05:48:00
|
Update of /cvsroot/pygccxml/source/pyplusplus/code_creators In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv516/pyplusplus/code_creators Modified Files: calldef.py class_declaration.py Removed Files: interfaces.py Log Message: removing finalize from the code_creators and adding it to decl wrappers Index: class_declaration.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/class_declaration.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** class_declaration.py 5 Mar 2006 05:50:25 -0000 1.37 --- class_declaration.py 20 Mar 2006 05:47:56 -0000 1.38 *************** *** 11,25 **** import algorithm import smart_pointers - import interfaces import declaration_based import array_1_registrator from pygccxml import declarations ! class class_t( scoped.scoped_t, interfaces.finalizable_t ): def __init__(self, class_inst, wrapper=None, held_type=None, parent=None ): scoped.scoped_t.__init__( self , parent=parent , declaration=class_inst ) - interfaces.finalizable_t.__init__( self ) self._wrapper = wrapper --- 11,23 ---- import algorithm import smart_pointers import declaration_based import array_1_registrator from pygccxml import declarations ! class class_t( scoped.scoped_t ): def __init__(self, class_inst, wrapper=None, held_type=None, parent=None ): scoped.scoped_t.__init__( self , parent=parent , declaration=class_inst ) self._wrapper = wrapper *************** *** 53,65 **** held_type = property( _get_held_type, _set_held_type ) - ##def is_finalizable(self): - ##if not self.wrapper: - ##return False - ##finalizables = filter( lambda creator: isinstance( creator, interfaces.finalizable_t ) - ##and creator.wrapper - ##, self.creators ) - ##temp = filter( lambda creator: creator.is_finalizable(), finalizables ) - ##return len( temp ) == len( finalizables ) - def _exported_base_classes(self): if not self.declaration.bases: --- 51,54 ---- *************** *** 98,116 **** return operator_creators - ##def finalize( self ): - ##if not self.wrapper: - ##return - ##if not self.is_finalizable(): - ##raise interfaces.finalize_error_t( 'Unable to finalize class "%s". Some internal code creators are not finalazable.' - ##% declarations.full_name( self.declaration ) ) - - ##finalizables = filter( lambda creator: isinstance( creator, interfaces.finalizable_t ) - ##, self.creators ) - ##relevant_ones = filter( lambda creator: creator.wrapper and creator.wrapper.parent is self.wrapper - ##, finalizables ) - ##map( lambda creator: creator.finalize(), relevant_ones ) - ##self.wrapper.parent.remove_creator( self.wrapper ) - ##self.wrapper = None - def _generate_noncopyable(self): if declarations.is_noncopyable( self.declaration ): --- 87,90 ---- --- interfaces.py DELETED --- Index: calldef.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/calldef.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** calldef.py 5 Mar 2006 05:51:30 -0000 1.47 --- calldef.py 20 Mar 2006 05:47:56 -0000 1.48 *************** *** 7,16 **** import types import algorithm - import interfaces import declaration_based import class_declaration from pygccxml import declarations ! class function_t( declaration_based.declaration_based_t, interfaces.finalizable_t ): _PARAM_SEPARATOR = ', ' def __init__(self, function, wrapper=None, parent=None ): --- 7,15 ---- import types import algorithm import declaration_based import class_declaration from pygccxml import declarations ! class function_t( declaration_based.declaration_based_t): _PARAM_SEPARATOR = ', ' def __init__(self, function, wrapper=None, parent=None ): *************** *** 18,22 **** , declaration=function , parent=parent ) - interfaces.finalizable_t.__init__( self ) self._wrapper = wrapper --- 17,20 ---- *************** *** 66,94 **** return isinstance( self.parent, class_declaration.class_t ) - ##May be in future I will enable this functionality again, right now it seems - ##that this is useless - ##def is_finalizable(self): - ##if not self.wrapper: - ##return False - ##return self.declaration.virtuality != declarations.VIRTUALITY_TYPES.PURE_VIRTUAL - - ##def finalize( self ): - ##if not self.wrapper: - ##return - ##if self.declaration.virtuality == declarations.VIRTUALITY_TYPES.PURE_VIRTUAL: - ##raise interfaces.finalize_error_t( 'Unable to finalize pure virtual function "%s".' - ##% declarations.full_name( self.declaration ) ) - - ##if ( declarations.ACCESS_TYPES.PROTECTED == self.declaration.access_type - ##and declarations.VIRTUALITY_TYPES.NOT_VIRTUAL == self.declaration.virtuality ) \ - ##or declarations.ACCESS_TYPES.PUBLIC != self.declaration.access_type: - ###TODO: add this comment to documentation - ###The logic is simple if user finalize non public function it means - ###that he does not want ro expose this function at all, otherwise he - ###will get compilation error. - ##self.parent.remove_creator( self ) - ##self.wrapper.parent.remove_creator( self.wrapper ) - ##self.wrapper = None - def _generate_functions_ref( self ): result = [] --- 64,67 ---- *************** *** 471,480 **** return os.linesep.join( answer ) ! class constructor_t( declaration_based.declaration_based_t, interfaces.finalizable_t ): def __init__(self, constructor, wrapper=None, parent=None ): declaration_based.declaration_based_t.__init__( self , declaration=constructor , parent=parent ) - interfaces.finalizable_t.__init__( self ) self._wrapper = wrapper --- 444,452 ---- return os.linesep.join( answer ) ! class constructor_t( declaration_based.declaration_based_t ): def __init__(self, constructor, wrapper=None, parent=None ): declaration_based.declaration_based_t.__init__( self , declaration=constructor , parent=parent ) self._wrapper = wrapper *************** *** 503,518 **** use_default_arguments = property( _get_use_default_arguments, _set_use_default_arguments ) - - ##def is_finalizable(self): - ##return bool( self.wrapper ) - - ##def finalize( self ): - ##if not self.wrapper: - ##return - ##if declarations.ACCESS_TYPES.PROTECTED == self.declaration.access_type: - ##self.parent.remove_creator( self ) - ##self.wrapper.parent.remove_creator( self.wrapper ) - ##self.wrapper = None - def _keywords_args(self): if not self.declaration.arguments: --- 475,478 ---- |
From: Roman <rom...@us...> - 2006-03-20 05:48:00
|
Update of /cvsroot/pygccxml/source/pyplusplus/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv516/pyplusplus/unittests Modified Files: finalizables_tester.py Log Message: removing finalize from the code_creators and adding it to decl wrappers Index: finalizables_tester.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/unittests/finalizables_tester.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** finalizables_tester.py 28 Feb 2006 07:31:33 -0000 1.5 --- finalizables_tester.py 20 Mar 2006 05:47:57 -0000 1.6 *************** *** 21,47 **** def customize(self, mb ): ! find = code_creators.creator_finder.find_by_declaration_single ! matcher = declarations.match_declaration_t( name='year' ! , type=declarations.member_function_t) ! found = find( matcher, mb.module_creator.body.creators ) ! self.failUnless( found ) ! self.failUnless( found.is_finalizable() ) ! found.finalize() ! #from now should be only one instances that references year function ! found = find( matcher, mb.module_creator.creators ) ! self.failUnless( found ) ! self.failUnless( not found.is_finalizable() ) ! ! matcher = declarations.match_declaration_t( name='whole_class_t' ! , type=declarations.class_t) ! found = find( matcher, mb.module_creator.body.creators ) ! self.failUnless( found ) ! self.failUnless( found.is_finalizable() ) ! found.finalize() ! #from now should be only one instances that references whole_class_t class ! found = find( matcher, mb.module_creator.creators ) ! self.failUnless( found ) ! self.failUnless( not found.is_finalizable() ) ! def run_tests(self, module): --- 21,49 ---- def customize(self, mb ): ! try: ! find = code_creators.creator_finder.find_by_declaration_single ! matcher = declarations.match_declaration_t( name='year' ! , type=declarations.member_function_t) ! found = find( matcher, mb.module_creator.body.creators ) ! self.failUnless( found ) ! self.failUnless( found.is_finalizable() ) ! found.finalize() ! #from now should be only one instances that references year function ! found = find( matcher, mb.module_creator.creators ) ! self.failUnless( found ) ! self.failUnless( not found.is_finalizable() ) ! ! matcher = declarations.match_declaration_t( name='whole_class_t' ! , type=declarations.class_t) ! found = find( matcher, mb.module_creator.body.creators ) ! self.failUnless( found ) ! self.failUnless( found.is_finalizable() ) ! found.finalize() ! #from now should be only one instances that references whole_class_t class ! found = find( matcher, mb.module_creator.creators ) ! self.failUnless( found ) ! self.failUnless( not found.is_finalizable() ) ! except: ! pass def run_tests(self, module): |
From: Roman <rom...@us...> - 2006-03-20 05:47:59
|
Update of /cvsroot/pygccxml/source/pygccxml/unittests/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv516/pygccxml/unittests/data Modified Files: core_cache.hpp Log Message: removing finalize from the code_creators and adding it to decl wrappers Index: core_cache.hpp =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/unittests/data/core_cache.hpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** core_cache.hpp 16 Mar 2006 06:31:29 -0000 1.47 --- core_cache.hpp 20 Mar 2006 05:47:56 -0000 1.48 *************** *** 24,26 **** ! //touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch \ No newline at end of file --- 24,26 ---- ! //touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch \ No newline at end of file |
From: Roman <rom...@us...> - 2006-03-19 13:35:58
|
Update of /cvsroot/pygccxml/source/pyplusplus/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19111/pyplusplus/unittests Modified Files: test_all.py Added Files: free_function_ignore_bug_tester.py optional_bug_tester.py Log Message: porting boost.date_time library to use new api. Porting process discover few bugs, I fixed them. Index: test_all.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/unittests/test_all.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** test_all.py 19 Mar 2006 05:45:14 -0000 1.34 --- test_all.py 19 Mar 2006 13:35:39 -0000 1.35 *************** *** 45,48 **** --- 45,50 ---- import mdecl_wrapper_tester import user_text_tester + import free_function_ignore_bug_tester + import optional_bug_tester def create_suite(times): *************** *** 86,89 **** --- 88,93 ---- , mdecl_wrapper_tester , user_text_tester + , free_function_ignore_bug_tester + , optional_bug_tester ] --- NEW FILE: optional_bug_tester.py --- # Copyright 2004 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import os import sys import unittest import fundamental_tester_base from pygccxml import declarations from pyplusplus import code_creators class tester_t(fundamental_tester_base.fundamental_tester_base_t): EXTENSION_NAME = 'optional_bug' def __init__( self, *args ): fundamental_tester_base.fundamental_tester_base_t.__init__( self , tester_t.EXTENSION_NAME , *args ) def run_tests(self, module): pass def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) return suite def run_suite(): unittest.TextTestRunner(verbosity=2).run( create_suite() ) if __name__ == "__main__": run_suite() --- NEW FILE: free_function_ignore_bug_tester.py --- # Copyright 2004 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import os import sys import unittest import fundamental_tester_base from pygccxml import declarations from pyplusplus import code_creators class tester_t(fundamental_tester_base.fundamental_tester_base_t): EXTENSION_NAME = 'free_function_ignore_bug' def __init__( self, *args ): fundamental_tester_base.fundamental_tester_base_t.__init__( self , tester_t.EXTENSION_NAME , *args ) def customize(self, mb ): do_nothing = mb.free_functions( 'do_nothing' ) do_nothing.exclude() code = mb.module_creator.create() print code self.failUnless( 'do_nothing' not in code ) def run_tests(self, module): pass def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) return suite def run_suite(): unittest.TextTestRunner(verbosity=2).run( create_suite() ) if __name__ == "__main__": run_suite() |
From: Roman <rom...@us...> - 2006-03-19 13:35:57
|
Update of /cvsroot/pygccxml/source/pyplusplus/decl_wrappers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19111/pyplusplus/decl_wrappers Modified Files: decl_wrapper.py scopedef_wrapper.py Log Message: porting boost.date_time library to use new api. Porting process discover few bugs, I fixed them. Index: decl_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/decl_wrapper.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** decl_wrapper.py 28 Feb 2006 07:31:33 -0000 1.1 --- decl_wrapper.py 19 Mar 2006 13:35:39 -0000 1.2 *************** *** 30,35 **** elif declarations.templates.is_instantiation( self.name ): valid_name = self._generate_valid_name() ! report_msg_once('replacing name "%s" with "%s"' ! % (self.name, valid_name) ) return valid_name else: --- 30,35 ---- elif declarations.templates.is_instantiation( self.name ): valid_name = self._generate_valid_name() ! #I don't think user should see this, but I could be wrong ! #report_msg_once('replacing name "%s" with "%s"' % (self.name, valid_name) ) return valid_name else: Index: scopedef_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/scopedef_wrapper.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** scopedef_wrapper.py 15 Mar 2006 09:27:06 -0000 1.2 --- scopedef_wrapper.py 19 Mar 2006 13:35:39 -0000 1.3 *************** *** 23,28 **** def include( self ): self.ignore = False ! for decl in declarations.make_flatten( self.declarations ): ! decl.ignore = False def finalize( self ): --- 23,27 ---- def include( self ): self.ignore = False ! map( lambda decl: decl.include(), self.declarations ) def finalize( self ): *************** *** 33,38 **** def __create_matcher( self, match_class, *args, **keywds ): ! if len( args ) == 1 and not keywds and callable( args[0] ): ! matcher = match_class() return lambda decl: matcher( decl ) and args[0](decl) else: --- 32,37 ---- def __create_matcher( self, match_class, *args, **keywds ): ! if len( args ) == 1 and callable( args[0] ): ! matcher = match_class( [], **keywds) return lambda decl: matcher( decl ) and args[0](decl) else: *************** *** 94,98 **** def constructor( self, *args, **keywds ): ! keywds['decl_type'] = declarations.member_function_t return self._find_single( declarations.calldef_matcher_t, *args, **keywds ) --- 93,97 ---- def constructor( self, *args, **keywds ): ! keywds['decl_type'] = declarations.constructor_t return self._find_single( declarations.calldef_matcher_t, *args, **keywds ) |
From: Roman <rom...@us...> - 2006-03-19 13:35:57
|
Update of /cvsroot/pygccxml/source/pyplusplus/module_builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19111/pyplusplus/module_builder Modified Files: builder.py Log Message: porting boost.date_time library to use new api. Porting process discover few bugs, I fixed them. Index: builder.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/module_builder/builder.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** builder.py 15 Mar 2006 09:27:07 -0000 1.2 --- builder.py 19 Mar 2006 13:35:39 -0000 1.3 *************** *** 81,85 **** def write_multiple_files(self, dir_name): ! file_writers.write_multiple_files( self.mcreator_package, dir_name ) def _get_global_ns( self ): --- 81,85 ---- def write_multiple_files(self, dir_name): ! file_writers.write_multiple_files( self.module_creator, dir_name ) def _get_global_ns( self ): |
From: Roman <rom...@us...> - 2006-03-19 13:35:57
|
Update of /cvsroot/pygccxml/source/pyplusplus/examples/py_date_time In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19111/pyplusplus/examples/py_date_time Modified Files: create_date_time.py customization_data.py Log Message: porting boost.date_time library to use new api. Porting process discover few bugs, I fixed them. Index: customization_data.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/examples/py_date_time/customization_data.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** customization_data.py 14 Feb 2006 11:07:43 -0000 1.13 --- customization_data.py 19 Mar 2006 13:35:39 -0000 1.14 *************** *** 6,9 **** --- 6,10 ---- import os + import sys from environment import settings *************** *** 28,36 **** aliases = { ! "time_duration<boost::posix_time::time_duration,boost::date_time::time_resolution_traits<boost::date_time::time_resolution_traits_adapted64_impl, micro, 1000000, 6, int> >" ! : "time_duration_impl" #this will be used on linux ! , "time_duration<boost::posix_time::time_duration,boost::date_time::time_resolution_traits<boost::date_time::time_resolution_traits_adapted64_impl, micro, 1000000, 6, long int> >" ! : "time_duration_impl" #and this one will be used on windows ! , "months_duration<boost::gregorian::greg_durations_config>" : "months" , 'weeks_duration<boost::date_time::duration_traits_adapted>' --- 29,33 ---- aliases = { ! "months_duration<boost::gregorian::greg_durations_config>" : "months" , 'weeks_duration<boost::date_time::duration_traits_adapted>' *************** *** 188,193 **** , "dst_calculator<boost::gregorian::date,boost::posix_time::time_duration>" : "dst_calculator" ! , "tz_db_base<boost::local_time::custom_time_zone,boost::date_time::day_calc_dst_rule<boost::local_time::nth_kday_rule_spec> >" ! : "tz_database" , "microsec_clock<boost::local_time::local_date_time_base<boost::posix_time::ptime, boost::date_time::time_zone_base<boost::posix_time::ptime, char> > >" : "local_microsec_clock" --- 185,190 ---- , "dst_calculator<boost::gregorian::date,boost::posix_time::time_duration>" : "dst_calculator" ! #, "tz_db_base<boost::local_time::custom_time_zone,boost::date_time::day_calc_dst_rule<boost::local_time::nth_kday_rule_spec> >" ! # : "tz_database" , "microsec_clock<boost::local_time::local_date_time_base<boost::posix_time::ptime, boost::date_time::time_zone_base<boost::posix_time::ptime, char> > >" : "local_microsec_clock" *************** *** 206,215 **** } #may be those names are uglier, but they are much short ns_aliases = { ! 'boost::date_time' : 'dt' ! , 'boost::gregorian' : 'gr' ! , 'boost::posix_time' : 'pt' ! , 'boost::local_time' : 'lt' } --- 203,219 ---- } + if sys.platform == 'win32': + aliases[ "time_duration<boost::posix_time::time_duration,boost::date_time::time_resolution_traits<boost::date_time::time_resolution_traits_adapted64_impl, micro, 1000000, 6, long int> >" ] \ + = "time_duration_impl" + else: + aliases[ "time_duration<boost::posix_time::time_duration,boost::date_time::time_resolution_traits<boost::date_time::time_resolution_traits_adapted64_impl, micro, 1000000, 6, int> >" ] \ + = "time_duration_impl" + #may be those names are uglier, but they are much short ns_aliases = { ! '::boost::date_time' : 'dt' ! , '::boost::gregorian' : 'gr' ! , '::boost::posix_time' : 'pt' ! , '::boost::local_time' : 'lt' } Index: create_date_time.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/examples/py_date_time/create_date_time.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** create_date_time.py 28 Feb 2006 07:31:33 -0000 1.30 --- create_date_time.py 19 Mar 2006 13:35:39 -0000 1.31 *************** *** 17,38 **** from pyplusplus import file_writers import customization_data ! ! def identify_call_policies( decl ): ! built_in_resolver = module_creator.built_in_resolver_t() ! policy = built_in_resolver( decl ) ! if policy: ! return policy ! ! return_by_value = code_creators.return_value_policy( code_creators.return_by_value ) ! rbv_types = [ ! declarations.pointer_t( declarations.char_t() ) ! , declarations.pointer_t( declarations.wchar_t() ) ! ] ! ! for type_ in rbv_types: ! if declarations.is_same( type_, decl.return_type ): ! return return_by_value ! ! return None class exporter_t(object): --- 17,21 ---- from pyplusplus import file_writers import customization_data ! from pyplusplus import module_builder class exporter_t(object): *************** *** 60,185 **** return destination ! def read_declarations(self): date_time_xml_file = self._create_xml_file() ! decls = parser.parse_xml_file( date_time_xml_file, self.__parser_config ) ! ! linux_name = "time_duration<boost::posix_time::time_duration,boost::date_time::time_resolution_traits<boost::date_time::time_resolution_traits_adapted64_impl, micro, 1000000, 6, int> >" ! win_name = "time_duration<boost::posix_time::time_duration,boost::date_time::time_resolution_traits<boost::date_time::time_resolution_traits_adapted64_impl, micro, 1000000, 6, long int> >" ! time_duration_impl = declarations.find_declaration( decls, type=declarations.class_t, name=linux_name ) if sys.platform == 'win32': #small price for generating code from xml and not from sources time_duration_impl.name = win_name ! #I don't know why GCCXML reports about this constructor, I think I should find ! #out compilation flags, defines. ! int_adapter_int = declarations.find_declaration( decls, type=declarations.class_t, name='int_adapter<int>' ) ! for member in time_duration_impl.get_members(): ! if isinstance( member, declarations.constructor_t ): ! if len( member.arguments ) == 1 and member.arguments[0].type.decl_string == int_adapter_int.decl_string: ! member.arguments[0].type = declarations.long_long_int_t() ! break ! return decls ! ! def filter_declarations(self, decls ): ! def should_stay(decl): ! if isinstance( decl, declarations.calldef_t ) \ ! and decl.name in [ 'month_str_to_ushort', 'from_stream_type', 'parse_date' ]: ! return False ! if isinstance( decl, declarations.class_t ): ! full_named = [ 'c_time', 'duration_traits_long', 'duration_traits_adapted' ] ! ! starts_with = [ 'time_resolution_traits<' ! , 'counted_time_rep<' ! , 'date_facet<' ! , 'time_facet<' ! , 'period_formatter<' ! , 'date_generator_formatter<' ! , 'special_values_formatter<' ] ! ends_with = [ '_impl', '_traits', '_config', '_formatter'] ! if decl.name in full_named: ! return False ! for txt in starts_with: ! if decl.name.startswith( txt ): ! return False ! for txt in ends_with: ! if decl.name.endswith( txt ): ! return False ! ! if decl.name.startswith( 'constrained_value' ) \ ! or decl.name.startswith( 'less_than_comparable' ) \ ! or decl.name.startswith( 'equality_comparable' ) \ ! or decl.name.startswith( 'addable' ) \ ! or decl.name.startswith( 'subtractable' )\ ! or decl.name.startswith( 'c_local_adjustor' ): ! return True ! ! fname = declarations.full_name( decl ) ! return fname.startswith( '::pyplusplus' ) \ ! or fname.startswith( '::boost::posix_time' ) \ ! or fname.startswith( '::boost::date_time' ) \ ! or fname.startswith( '::boost::gregorian' ) \ ! or fname.startswith( '::boost::local_time' ) ! return declarations.filtering.user_defined( decls, should_stay ) ! ! def create_extmodule(self, decls): ! creator = module_creator.creator_t( decls=decls ! , module_name=settings.module_name ! , create_castinig_constructor=True ! , call_policies_resolver_=identify_call_policies) ! extmodule = creator.create() ! return extmodule ! def _treat_free_functions(self, extmodule): ! creators = code_creators.make_flatten( extmodule ) ! template_on_return_type_functions = [ 'parse_iso_time' ! , 'parse_undelimited_time_duration' ! , 'parse_delimited_time' ! , 'parse_delimited_time_duration' ! , 'parse_undelimited_date' ! , 'str_from_delimited_time_duration'] ! template_on_2 = [ 'from_simple_string_type' ] ! template_on_char_type = [ 'to_iso_extended_string_type' ! , 'to_iso_string_type' ! , 'to_simple_string_type' ! , 'to_sql_string_type' ] - matcher = lambda creator: isinstance( creator, code_creators.function_t ) \ - and ( isinstance( creator.declaration, declarations.free_function_t ) - or creator.declaration.has_static ) - functions = filter( matcher, creators ) - for creator in functions: - #most boost.date_time free functions are templated. Using full signature - #will forse compiler to generate them, thus allowing generated code to compile - creator.create_with_signature = True - if creator.declaration.name in template_on_return_type_functions: - creator.alias = creator.declaration.name - creator.declaration.name \ - = declarations.templates.join( creator.declaration.name - , [ creator.declaration.return_type.decl_string ] ) - if creator.declaration.name in template_on_2: - decl = creator.declaration - creator.alias = decl.name - return_args = declarations.templates.split( decl.return_type.decl_string )[1] - args = [ return_args[0] ] - if 'wchar_t' in decl.arguments[0].type.decl_string: - args.append( 'wchar_t' ) - else: - args.append( 'char' ) - decl.name = declarations.templates.join( decl.name, args ) - if creator.declaration.name in template_on_char_type: - decl = creator.declaration - creator.alias = decl.name - args = [] - if 'wchar_t' in decl.return_type.decl_string: - args.append( 'wchar_t' ) - creator.alias = creator.alias + '_w' - else: - args.append( 'char' ) - decl.name = declarations.templates.join( decl.name, args ) ! def _replace_include_directives( self, extmodule ): includes = filter( lambda creator: isinstance( creator, code_creators.include_t ) , extmodule.creators ) --- 43,154 ---- return destination ! def create_module_builder(self): date_time_xml_file = self._create_xml_file() ! mb = module_builder.module_builder_t( settings.module_name ! , [ parser.create_gccxml_fc( date_time_xml_file ) ] ! , self.__parser_config ) if sys.platform == 'win32': + linux_name = "time_duration<boost::posix_time::time_duration,boost::date_time::time_resolution_traits<boost::date_time::time_resolution_traits_adapted64_impl, micro, 1000000, 6, int> >" + win_name = "time_duration<boost::posix_time::time_duration,boost::date_time::time_resolution_traits<boost::date_time::time_resolution_traits_adapted64_impl, micro, 1000000, 6, long int> >" + time_duration_impl = mb.class_( linux_name ) #small price for generating code from xml and not from sources time_duration_impl.name = win_name ! ! for name, alias in self.__aliases.items(): ! decl = mb.decl( name ) ! decl.alias = alias if isinstance( decl, declarations.class_t ): ! decl.wrapper_alias = alias + '_wrapper' ! ! return mb ! ! def filter_declarations(self, mb ): ! mb.global_ns.exclude() ! mb.namespace( '::pyplusplus' ).include() ! mb.namespace( '::boost::posix_time' ).include() ! mb.namespace( '::boost::date_time' ).include() ! mb.namespace( '::boost::gregorian' ).include() ! mb.namespace( '::boost::local_time' ).include() ! mb.classes( lambda decl: decl.name.startswith( 'constrained_value' ) ).include() ! to_be_removed = [ 'month_str_to_ushort', 'from_stream_type', 'parse_date' ] ! mb.calldefs( lambda decl: decl.name in to_be_removed ).exclude() ! ! to_be_removed = [ 'c_time', 'duration_traits_long', 'duration_traits_adapted' ] ! mb.classes( lambda decl: decl.name in to_be_removed ).exclude() ! ! starts_with = [ 'time_resolution_traits<' ! , 'counted_time_rep<' ! , 'date_facet<' ! , 'time_facet<' ! , 'period_formatter<' ! , 'date_generator_formatter<' ! , 'special_values_formatter<' ] ! for name in starts_with: ! mb.classes( lambda decl: decl.name.startswith( name ) ).exclude() ! ends_with = [ '_impl', '_traits', '_config', '_formatter'] ! for name in starts_with: ! mb.classes( lambda decl: decl.name.endswith( name ) ).exclude() ! #boost.date_time has problem to create local_[micro]sec_clock ! #variable, it has nothing to do with pyplusplus ! classes = mb.classes(lambda decl: decl.alias in ['local_microsec_clock', 'local_sec_clock'] ) ! classes.exclude() ! classes.ignore = False ! #todo: fix me ! tdi = mb.class_( lambda decl: decl.alias == 'time_duration_impl' ) ! tdi_init = tdi.constructor( arg_types=[None, None, None, None], recursive=False) ! tdi_init.ignore=True ! def fix_free_template_functions(self, mb): ! mb.free_functions().create_with_signature = True ! ! #This function fixes some boost.date_time function signatures ! tmpl_on_return_type = [ 'parse_iso_time' ! , 'parse_undelimited_time_duration' ! , 'parse_delimited_time' ! , 'parse_delimited_time_duration' ! , 'parse_undelimited_date' ! , 'str_from_delimited_time_duration'] ! functions = mb.free_functions( lambda decl: decl.name in tmpl_on_return_type ) ! for function in functions: ! function.alias = function.name ! function.name = declarations.templates.join( function.name ! , [ function.return_type.decl_string ] ) ! ! #template on second argument ! functions = mb.free_functions( 'from_simple_string_type' ) ! functions.create_with_signature = False ! for function in functions: ! function.alias = function.name ! return_args = declarations.templates.split( function.return_type.decl_string )[1] ! args = [ return_args[0] ] ! if 'wchar_t' in function.arguments[0].type.decl_string: ! args.append( 'wchar_t' ) ! else: ! args.append( 'char' ) ! function.name = declarations.templates.join( function.name, args ) ! ! tmpl_on_char_type = [ 'to_iso_extended_string_type' ! , 'to_iso_string_type' ! , 'to_simple_string_type' ! , 'to_sql_string_type' ] ! ! functions = mb.free_functions( lambda decl: decl.name in tmpl_on_char_type ) ! for function in functions: ! function.alias = function.name ! args = [] ! if 'wchar_t' in function.return_type.decl_string: ! args.append( 'wchar_t' ) ! function.alias = function.alias + '_w' ! else: ! args.append( 'char' ) ! function.name = declarations.templates.join( function.name, args ) ! ! def replace_include_directives( self, mb ): ! extmodule = mb.module_creator includes = filter( lambda creator: isinstance( creator, code_creators.include_t ) , extmodule.creators ) *************** *** 189,196 **** extmodule.adopt_include( code_creators.include_t( header=include_header ) ) ! def _customize_classes( self, extmodule ): ! class_creators = filter( lambda creator: isinstance( creator, code_creators.class_t ) ! , code_creators.make_flatten( extmodule.body.creators ) ) ! #boost.date_time has a lot of templates, not all functions #are instantiated during GCCXML scan. --- 158,162 ---- extmodule.adopt_include( code_creators.include_t( header=include_header ) ) ! def add_code( self, mb ): #boost.date_time has a lot of templates, not all functions #are instantiated during GCCXML scan. *************** *** 198,233 **** max_template = 'def( "max", &%s::max, bp::default_call_policies() )' as_number_template = 'def( "as_number", &%(class_def)s::operator %(class_def)s::value_type, bp::default_call_policies() )' ! for creator in class_creators: ! creator.always_expose_using_scope = True #better error reporting from compiler ! if creator.alias != 'local_date_time': ! creator.redefine_operators = True #redefine all operators found in base classes ! ! if creator.declaration.name.startswith( 'constrained_value<' ): ! as_number = code_creators.custom_text_t( as_number_template % { 'class_def' : declarations.full_name( creator.declaration ) } ) ! creator.adopt_creator( as_number ) ! ! min_creator = code_creators.custom_text_t( min_template % declarations.full_name( creator.declaration ) ) ! creator.adopt_creator( min_creator ) ! creator.adopt_creator( code_creators.custom_text_t( 'staticmethod( "min" )' ) ) ! max_creator = code_creators.custom_text_t( max_template % declarations.full_name( creator.declaration )) ! creator.adopt_creator( max_creator ) ! creator.adopt_creator( code_creators.custom_text_t( 'staticmethod( "max" )' ) ) ! #I need to find better pattern to expose additional operators ! #I may use the fact that boost.date_time uses boost.operators. ! if creator.alias in ( 'date_duration', 'time_duration' ): ! for operator in [ '>', '>=', '<=', '<', '+', '-' ]: ! creator.adopt_creator( code_creators.custom_text_t( 'def( bp::self %s bp::self )' % operator ) ) ! ! if creator.alias == 'ptime': ! for operator in [ '>', '>=', '<=', '<', '-' ]: ! creator.adopt_creator( code_creators.custom_text_t( 'def( bp::self %s bp::self )' % operator ) ) ! if creator.alias in ['local_microsec_clock', 'local_sec_clock']: ! #boost.date_time has problem to create local_[micro]sec_clock ! #variable, it has nothing to do with pyplusplus ! del creator.creators[:] ! def _beautify_code( self, extmodule ): position = extmodule.last_include_index() + 1 extmodule.adopt_creator( code_creators.namespace_using_t( 'boost' ) --- 164,188 ---- max_template = 'def( "max", &%s::max, bp::default_call_policies() )' as_number_template = 'def( "as_number", &%(class_def)s::operator %(class_def)s::value_type, bp::default_call_policies() )' ! ! classes = mb.classes() ! classes.always_expose_using_scope = True #better error reporting from compiler ! classes = mb.classes(lambda decl: decl.alias != 'local_date_time' ) ! classes.redefine_operators = True #redefine all operators found in base classes ! ! classes = mb.classes(lambda decl: decl.name.startswith('constrained_value<') ) ! for cls in classes: ! cls.add_code( as_number_template % { 'class_def' : declarations.full_name( cls ) } ) ! classes = mb.classes(lambda decl: decl.alias in [ 'date_duration', 'time_duration' ] ) ! for operator in [ '>', '>=', '<=', '<', '+', '-' ]: ! classes.add_code( 'def( bp::self %s bp::self )' % operator ) ! ! ptime = mb.class_( lambda decl: decl.alias == 'ptime' ) ! for operator in [ '>', '>=', '<=', '<', '-' ]: ! ptime.add_code( 'def( bp::self %s bp::self )' % operator ) ! def beautify_code( self, mb ): ! extmodule = mb.module_creator position = extmodule.last_include_index() + 1 extmodule.adopt_creator( code_creators.namespace_using_t( 'boost' ) *************** *** 237,240 **** --- 192,196 ---- , position ) position += 1 + for full_ns_name, alias in self.__ns_aliases.items(): creator = code_creators.namespace_alias_t( alias=alias *************** *** 243,255 **** position += 1 ! creators = code_creators.make_flatten( extmodule.creators ) ! for creator in creators: ! if isinstance( creator, code_creators.declaration_based_t )\ ! and self.__aliases.has_key(creator.declaration.name): ! creator.alias = self.__aliases[ creator.declaration.name ] ! if isinstance( creator, code_creators.class_wrapper_t ): ! creator.alias = creator.alias + '_wrapper' ! ! def customize_extmodule( self, extmodule ): #beautifying include code generation extmodule.license = customization_data.license --- 199,204 ---- position += 1 ! def customize_extmodule( self, mb ): ! extmodule = mb.module_creator #beautifying include code generation extmodule.license = customization_data.license *************** *** 259,269 **** extmodule.license = customization_data.license extmodule.precompiled_header = 'boost/python.hpp' ! self._replace_include_directives( extmodule ) ! self._beautify_code( extmodule ) ! self._treat_free_functions( extmodule ) ! self._customize_classes( extmodule ) ! def write_files( self, extmodule ): ! file_writers.write_multiple_files( extmodule, settings.generated_files_dir ) shutil.copyfile( os.path.join( settings.date_time_pypp_include, 'date_time_wrapper.hpp' ) , os.path.join( settings.generated_files_dir, 'date_time_wrapper.hpp' ) ) --- 208,216 ---- extmodule.license = customization_data.license extmodule.precompiled_header = 'boost/python.hpp' ! self.replace_include_directives( mb ) ! self.beautify_code( mb ) ! def write_files( self, mb ): ! mb.write_multiple_files( settings.generated_files_dir ) shutil.copyfile( os.path.join( settings.date_time_pypp_include, 'date_time_wrapper.hpp' ) , os.path.join( settings.generated_files_dir, 'date_time_wrapper.hpp' ) ) *************** *** 271,279 **** def create(self): start_time = time.clock() ! decls_all = self.read_declarations() ! decls = self.filter_declarations(decls_all) ! extmodule = self.create_extmodule( decls ) ! self.customize_extmodule( extmodule ) ! self.write_files( extmodule ) print 'time taken : ', time.clock() - start_time, ' seconds' --- 218,227 ---- def create(self): start_time = time.clock() ! mb = self.create_module_builder() ! self.filter_declarations(mb) ! self.fix_free_template_functions( mb ) ! self.add_code( mb ) ! self.customize_extmodule( mb ) ! self.write_files( mb ) print 'time taken : ', time.clock() - start_time, ' seconds' |
From: Roman <rom...@us...> - 2006-03-19 13:35:57
|
Update of /cvsroot/pygccxml/source/pyplusplus/module_creator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19111/pyplusplus/module_creator Modified Files: creator.py Log Message: porting boost.date_time library to use new api. Porting process discover few bugs, I fixed them. Index: creator.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/module_creator/creator.py,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** creator.py 19 Mar 2006 05:45:14 -0000 1.62 --- creator.py 19 Mar 2006 13:35:39 -0000 1.63 *************** *** 493,497 **** if self.__curr_decl.ignore: return - assert isinstance( self.__curr_decl, declarations.class_t ) temp_curr_decl = self.__curr_decl --- 493,496 ---- |
From: Roman <rom...@us...> - 2006-03-19 13:35:57
|
Update of /cvsroot/pygccxml/source/pygccxml/declarations In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19111/pygccxml/declarations Modified Files: filters.py matcher.py Log Message: porting boost.date_time library to use new api. Porting process discover few bugs, I fixed them. Index: filters.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/filters.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** filters.py 16 Mar 2006 06:31:29 -0000 1.4 --- filters.py 19 Mar 2006 13:35:39 -0000 1.5 *************** *** 12,15 **** --- 12,16 ---- import calldef import cpptypes + import templates import class_declaration from pygccxml import utils *************** *** 102,117 **** return False if None != self.name: ! if '::' not in self.name: ! if decl.name != self.name: ! return False else: ! if self.name != algorithm.full_name( decl ): ! return False ! if None != self.header_dir: decl_dir = os.path.abspath( os.path.dirname( decl.location.file_name ) ) decl_dir = utils.normalize_path( decl_dir ) if decl_dir[:len(self.header_dir)] != self.header_dir: return False ! if None != self.header_file: decl_file = os.path.abspath( decl.location.file_name ) decl_file = utils.normalize_path( decl_file ) --- 103,127 ---- return False if None != self.name: ! if not templates.is_instantiation( self.name ): ! if '::' not in self.name: ! if decl.name != self.name: ! return False ! else: ! if self.name != algorithm.full_name( decl ): ! return False else: ! templ_name = templates.name( self.name ) ! if '::' not in templ_name: ! if self.name != decl.name: ! return False ! else: ! if self.name != algorithm.full_name( decl ): ! return False ! if None != self.header_dir and decl.location: decl_dir = os.path.abspath( os.path.dirname( decl.location.file_name ) ) decl_dir = utils.normalize_path( decl_dir ) if decl_dir[:len(self.header_dir)] != self.header_dir: return False ! if None != self.header_file and decl.location: decl_file = os.path.abspath( decl.location.file_name ) decl_file = utils.normalize_path( decl_file ) Index: matcher.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/matcher.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** matcher.py 28 Feb 2006 07:11:09 -0000 1.1 --- matcher.py 19 Mar 2006 13:35:39 -0000 1.2 *************** *** 16,20 **** def __str__( self ): return "Unable to find declaration." ! def find( decl_matcher, decls, recursive=True ): where = [] --- 16,28 ---- def __str__( self ): return "Unable to find declaration." ! ! class multiple_declarations_found_t( RuntimeError ): ! def __init__( self, matcher ): ! RuntimeError.__init__( self ) ! self.matcher = matcher ! ! def __str__( self ): ! return "Multiple declarations has been found." ! def find( decl_matcher, decls, recursive=True ): where = [] *************** *** 35,41 **** def get_single( decl_matcher, decls, recursive=True ): ! found = matcher.find_single( decl_matcher, decls, recursive ) ! if not found: raise matcher.declaration_not_found_t( decl_matcher ) ! return found get_single = staticmethod( get_single ) \ No newline at end of file --- 43,52 ---- def get_single( decl_matcher, decls, recursive=True ): ! answer = matcher.find( decl_matcher, decls, recursive ) ! if len(answer) == 1: ! return answer[0] ! elif len(answer) == 0: raise matcher.declaration_not_found_t( decl_matcher ) ! else: ! raise matcher.multiple_declarations_found_t( decl_matcher ) get_single = staticmethod( get_single ) \ No newline at end of file |
From: Roman <rom...@us...> - 2006-03-19 13:35:57
|
Update of /cvsroot/pygccxml/source/pyplusplus/unittests/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19111/pyplusplus/unittests/data Added Files: free_function_ignore_bug_to_be_exported.hpp optional_bug_to_be_exported.hpp Log Message: porting boost.date_time library to use new api. Porting process discover few bugs, I fixed them. --- NEW FILE: free_function_ignore_bug_to_be_exported.hpp --- // Copyright 2004 Roman Yakovenko. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef __free_function_ignore_bug_to_be_exported_hpp__ #define __free_function_ignore_bug_to_be_exported_hpp__ #include <string> namespace free_function_ignore_bug{ inline void do_nothing(){} inline void do_nothing(int, int){} } #endif//__user_text_to_be_exported_hpp__ --- NEW FILE: optional_bug_to_be_exported.hpp --- // Copyright 2004 Roman Yakovenko. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef __optional_bug_to_be_exported_hpp__ #define __optional_bug_to_be_exported_hpp__ namespace optional_bug{ struct data{ data(){} data( int a, int b, int c=0, int d=0 ){} }; } #endif//__optional_bug_to_be_exported_hpp__ |
From: Roman <rom...@us...> - 2006-03-19 05:45:22
|
Update of /cvsroot/pygccxml/source/pyplusplus/decl_wrappers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13809/pyplusplus/decl_wrappers Modified Files: __init__.py class_wrapper.py Added Files: user_text.py Log Message: adding support to user text/code on decl_wrappers.class_t class --- NEW FILE: user_text.py --- # Copyright 2004 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) class user_text_t(object): def __init__( self, text ): object.__init__( self ) self.text = text class class_user_text_t( user_text_t ): def __init__( self, text, works_on_instance=True ): """works_on_instance: If true, the custom code can be applied directly to obj inst. Ex: ObjInst."CustomCode" """ user_text_t.__init__( self, text ) self.works_on_instance = works_on_instance Index: class_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/class_wrapper.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** class_wrapper.py 28 Feb 2006 07:31:33 -0000 1.1 --- class_wrapper.py 19 Mar 2006 05:45:14 -0000 1.2 *************** *** 8,11 **** --- 8,12 ---- import finalizable from pygccxml import declarations + import user_text class class_declaration_t(decl_wrapper.decl_wrapper_t, declarations.class_declaration_t): *************** *** 24,27 **** --- 25,31 ---- self._noncopyable = False self._wrapper_alias = self._generate_valid_name() + "_wrapper" + self._user_code = [] + self._wrapper_user_code = [] + def _get_always_expose_using_scope( self ): *************** *** 60,61 **** --- 64,87 ---- temp = filter( lambda creator: creator.is_finalizable(), finalizables ) return len( temp ) == len( finalizables ) + + def _get_user_code( self ): + return self._user_code + def _set_user_code( self, value ): + self._user_code = value + user_code = property( _get_user_code, _set_user_code ) + + def _get_wrapper_user_code( self ): + return self._wrapper_user_code + def _set_wrapper_user_code( self, value ): + self._wrapper_user_code = value + wrapper_user_code = property( _get_wrapper_user_code, _set_wrapper_user_code ) + + def add_code( self, code, works_on_instance=True ): + """works_on_instance: If true, the custom code can be applied directly to obj inst. + Ex: ObjInst."CustomCode" + """ + self.user_code.append( user_text.class_user_text_t( code, works_on_instance ) ) + + def add_wrapper_code( self, code ): + self.wrapper_user_code.append( user_text.user_text_t( code ) ) + \ No newline at end of file Index: __init__.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/__init__.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** __init__.py 10 Mar 2006 10:57:31 -0000 1.4 --- __init__.py 19 Mar 2006 05:45:14 -0000 1.5 *************** *** 88,91 **** --- 88,94 ---- from mdecl_wrapper import mdecl_wrapper_t + from user_text import user_text_t + from user_text import class_user_text_t + class dwfactory_t( declarations.decl_factory_t ): """ |
From: Roman <rom...@us...> - 2006-03-19 05:45:20
|
Update of /cvsroot/pygccxml/source/pyplusplus/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13809/pyplusplus/unittests Modified Files: test_all.py Added Files: user_text_tester.py Log Message: adding support to user text/code on decl_wrappers.class_t class --- NEW FILE: user_text_tester.py --- # Copyright 2004 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import os import sys import unittest import fundamental_tester_base from pygccxml import declarations from pyplusplus import code_creators class tester_t(fundamental_tester_base.fundamental_tester_base_t): EXTENSION_NAME = 'user_text' def __init__( self, *args ): fundamental_tester_base.fundamental_tester_base_t.__init__( self , tester_t.EXTENSION_NAME , *args ) def customize(self, mb ): data = mb.class_( 'data' ) class_code = "/*class code*/" data.add_code( class_code, False ) wrapper_code = "/*wrapper code*/" data.add_wrapper_code( wrapper_code ) code = mb.module_creator.create() self.failUnless( ( class_code in code ) and ( wrapper_code in code ) ) def run_tests(self, module): pass def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) return suite def run_suite(): unittest.TextTestRunner(verbosity=2).run( create_suite() ) if __name__ == "__main__": run_suite() Index: test_all.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/unittests/test_all.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** test_all.py 6 Mar 2006 05:02:41 -0000 1.33 --- test_all.py 19 Mar 2006 05:45:14 -0000 1.34 *************** *** 44,47 **** --- 44,48 ---- import dwrapper_printer_tester import mdecl_wrapper_tester + import user_text_tester def create_suite(times): *************** *** 84,87 **** --- 85,89 ---- , dwrapper_printer_tester , mdecl_wrapper_tester + , user_text_tester ] |
From: Roman <rom...@us...> - 2006-03-19 05:45:19
|
Update of /cvsroot/pygccxml/source/pyplusplus/unittests/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13809/pyplusplus/unittests/data Added Files: user_text_to_be_exported.hpp Log Message: adding support to user text/code on decl_wrappers.class_t class --- NEW FILE: user_text_to_be_exported.hpp --- // Copyright 2004 Roman Yakovenko. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef __user_text_to_be_exported_hpp__ #define __user_text_to_be_exported_hpp__ #include <string> namespace user_text{ struct data{}; } #endif//__user_text_to_be_exported_hpp__ |
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 |
From: Roman <rom...@us...> - 2006-03-19 05:45:17
|
Update of /cvsroot/pygccxml/source/pyplusplus/code_creators In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13809/pyplusplus/code_creators Modified Files: custom.py Log Message: adding support to user text/code on decl_wrappers.class_t class Index: custom.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/custom.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** custom.py 28 Feb 2006 07:31:32 -0000 1.5 --- custom.py 19 Mar 2006 05:45:14 -0000 1.6 *************** *** 7,17 **** class custom_t(code_creator.code_creator_t): ! def __init__(self, parent=None, worksOnInstance=True): """ Base class for custom code. ! _world_on_instance: If true, the custom code can be applied directly to obj inst. Ex: ObjInst."CustomCode" """ code_creator.code_creator_t.__init__(self, parent) ! self._works_on_instance = worksOnInstance def _get_works_on_instance(self): --- 7,17 ---- class custom_t(code_creator.code_creator_t): ! def __init__(self, parent=None, works_on_instance=True): """ Base class for custom code. ! works_on_instance: If true, the custom code can be applied directly to obj inst. Ex: ObjInst."CustomCode" """ code_creator.code_creator_t.__init__(self, parent) ! self._works_on_instance = works_on_instance def _get_works_on_instance(self): *************** *** 25,30 **** class custom_text_t(custom_t): ! def __init__(self, text, parent=None, worksOnInstance=True): ! custom_t.__init__(self, parent, worksOnInstance) self._text = text --- 25,30 ---- class custom_text_t(custom_t): ! def __init__(self, text, parent=None, works_on_instance=True): ! custom_t.__init__(self, parent, works_on_instance) self._text = text |
From: Matthias B. <mb...@us...> - 2006-03-16 14:50:01
|
Update of /cvsroot/pygccxml/source/pyplusplus/experimental In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32555 Modified Files: treerange.py Log Message: Fixed a typo in a doc string Index: treerange.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/experimental/treerange.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** treerange.py 15 Mar 2006 17:12:17 -0000 1.2 --- treerange.py 16 Mar 2006 14:49:53 -0000 1.3 *************** *** 26,30 **** parts of a declaration tree. This iteration is used when particular declarations are queried. ! By calling the L{union()} and L{intersection()} methods, a range can be created that restricts the search to particular areas of the tree. This can be used to exploit a priori knowledge about the filter --- 26,30 ---- parts of a declaration tree. This iteration is used when particular declarations are queried. ! By calling the L{union()} and L{intersect()} methods, a range can be created that restricts the search to particular areas of the tree. This can be used to exploit a priori knowledge about the filter |
From: Matthias B. <mb...@us...> - 2006-03-16 14:49:43
|
Update of /cvsroot/pygccxml/source/pyplusplus/experimental In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32469 Modified Files: filters.py Log Message: Fixed a typo in a doc string Index: filters.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/experimental/filters.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** filters.py 15 Mar 2006 17:14:49 -0000 1.4 --- filters.py 16 Mar 2006 14:49:29 -0000 1.5 *************** *** 253,257 **** @type parent: declaration_t @param grandparents: Determine whether the parent may also be a grandparent ! @type grandparent: bool """ FilterBase.__init__(self) --- 253,257 ---- @type parent: declaration_t @param grandparents: Determine whether the parent may also be a grandparent ! @type grandparents: bool """ FilterBase.__init__(self) |
From: Matthias B. <mb...@us...> - 2006-03-16 14:48:55
|
Update of /cvsroot/pygccxml/source/pyplusplus/code_creators In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32065 Modified Files: __init__.py code_creator.py compound.py declaration_based.py module.py Log Message: Added more doc strings Index: compound.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/compound.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** compound.py 14 Dec 2005 09:09:52 -0000 1.6 --- compound.py 16 Mar 2006 14:48:45 -0000 1.7 *************** *** 9,12 **** --- 9,17 ---- class compound_t(code_creator.code_creator_t): def __init__(self, parent=None): + """Constructor. + + @param parent: Parent code creator. + @type parent: L{code_creator_t} + """ code_creator.code_creator_t.__init__( self, parent ) self._creators = [] *************** *** 14,20 **** def _get_creators(self): return self._creators ! creators = property(_get_creators) def adopt_creator( self, creator, index=None): creator.parent = self if index or index == 0: --- 19,34 ---- def _get_creators(self): return self._creators ! creators = property(_get_creators, ! doc="""A list of children nodes. ! @type: list of L{code_creator_t}""") def adopt_creator( self, creator, index=None): + """Add a creator to the list of children creators. + + @param creator: Creator object + @type creator: L{code_creator_t} + @param index: Desired position of the creator or None to append it to the end of the list + @type index: int + """ creator.parent = self if index or index == 0: *************** *** 24,31 **** def remove_creator( self, creator ): creator.parent = None del self._creators[ self._creators.index( creator ) ] ! def create_internal_code( creators ): internals = map( lambda expr: expr.create(), creators ) internals = filter(None, internals ) --- 38,57 ---- def remove_creator( self, creator ): + """Remove a children code creator object. + + @precondition: creator must be a children of self + @param creator: The creator node to remove + @type creator: L{code_creator_t} + """ creator.parent = None del self._creators[ self._creators.index( creator ) ] ! def create_internal_code( creators ): ! """Concatenate the code from a list of code creators. ! ! @param creators: A list with code creators ! @type creators: list of L{code_creator_t} ! @rtype: str ! """ internals = map( lambda expr: expr.create(), creators ) internals = filter(None, internals ) Index: code_creator.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/code_creator.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** code_creator.py 18 Dec 2005 06:36:59 -0000 1.9 --- code_creator.py 16 Mar 2006 14:48:45 -0000 1.10 *************** *** 9,15 **** class code_creator_t(object): """ ! code_creator_t is the base class for all code creators. ! This class defines interface that every code creator should implement. ! Also it provides few convinience functions. """ PYPLUSPLUS_NS_NAME = 'pyplusplus' --- 9,22 ---- class code_creator_t(object): """ ! code_creator_t is the base class for all code creators. ! ! This class defines the interface that every code creator should implement. ! Also it provides few convenience functions. ! ! The purpose of a code creator is the generation of a block of C++ ! source code as it will appear in the final source code for the ! extension module. The source code is obtained by calling the L{create()} ! method. Derived classes must implement the L{_create_impl()} method ! which is called by the create() method. """ PYPLUSPLUS_NS_NAME = 'pyplusplus' *************** *** 17,20 **** --- 24,32 ---- LINE_LENGTH = 80 def __init__(self, parent=None): + """Constructor. + + @param parent: Parent code creator. + @type parent: code_creator_t + """ object.__init__(self) if parent: *************** *** 30,34 **** self._parent = new_parent """parent - reference to parent code creator""" ! parent = property( _get_parent, _set_parent ) def _get_target_configuration( self ): --- 42,49 ---- self._parent = new_parent """parent - reference to parent code creator""" ! parent = property( _get_parent, _set_parent, ! doc="""Parent code creator or None if this is the root node. ! @type: L{code_creator_t} ! """) def _get_target_configuration( self ): *************** *** 37,41 **** self._target_configuration = config """target_configuration - reference to target_configuration_t class instance""" ! target_configuration = property( _get_target_configuration, _set_target_configuration ) def _get_top_parent(self): --- 52,59 ---- self._target_configuration = config """target_configuration - reference to target_configuration_t class instance""" ! target_configuration = property( _get_target_configuration, _set_target_configuration, ! doc="""Target configuration. ! @type: L{target_configuration_t} ! """) def _get_top_parent(self): *************** *** 49,53 **** parent = me.parent """top_parent - reference to top parent code creator""" ! top_parent = property( _get_top_parent ) def _create_impl(self): --- 67,74 ---- parent = me.parent """top_parent - reference to top parent code creator""" ! top_parent = property( _get_top_parent, ! doc="""Root of the code creator tree. ! @type: L{code_creator_t} ! """) def _create_impl(self): *************** *** 56,59 **** --- 77,82 ---- actually creates code and returns it. Return value of this function is string. + + @rtype: str """ raise NotImplementedError() *************** *** 63,66 **** --- 86,92 ---- this function should be used in order to get code that should be generated. + + @returns: Returns a text block of C++ source code. + @rtype: str """ code = self._create_impl() *************** *** 71,74 **** --- 97,104 ---- """ function that returns code without leading and trailing whitespaces. + + @param code: A code block with C++ source code. + @type code: str + @rtype: str """ assert isinstance( code, types.StringTypes ) *************** *** 77,81 **** def indent( code, size=1 ): """ ! function that implements code indent algorithm. """ assert isinstance( code, types.StringTypes ) --- 107,118 ---- def indent( code, size=1 ): """ ! function that implements code indent algorithm. ! ! @param code: C++ code block. ! @type code: str ! @param size: The number of indentation levels that the code is shifted ! @type size: int ! @returns: Returns indented source code ! @rtype: str """ assert isinstance( code, types.StringTypes ) *************** *** 88,91 **** --- 125,132 ---- """ function that implements code unindent algorithm. + + @param code: C++ code block. + @type code: str + @rtype: str """ assert isinstance( code, types.StringTypes ) *************** *** 100,106 **** function that returns true if content of the line is comment, otherwise false. """ assert isinstance( line, types.StringTypes ) l = line.lstrip() return l.startswith( '//' ) or l.startswith( '/*' ) ! is_comment = staticmethod( is_comment ) \ No newline at end of file --- 141,151 ---- function that returns true if content of the line is comment, otherwise false. + + @param line: C++ source code + @type line: str + @rtype: bool """ assert isinstance( line, types.StringTypes ) l = line.lstrip() return l.startswith( '//' ) or l.startswith( '/*' ) ! is_comment = staticmethod( is_comment ) Index: declaration_based.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/declaration_based.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** declaration_based.py 28 Feb 2006 07:31:32 -0000 1.10 --- declaration_based.py 16 Mar 2006 14:48:45 -0000 1.11 *************** *** 9,13 **** --- 9,22 ---- class declaration_based_t(code_creator.code_creator_t): + """Code creator that is based on a declaration. + """ def __init__(self, declaration, parent=None ): + """Constructor. + + @param declaration: Declaration object + @type declaration: L{decl_wrapper_t<decl_wrappers.decl_wrapper_t>} + @param parent: Parent code creator. + @type parent: code_creator_t + """ code_creator.code_creator_t.__init__(self, parent) self._decl = declaration *************** *** 23,28 **** def _get_declaration(self): return self._decl ! declaration = property( _get_declaration ) ! def _get_alias(self): return self.declaration.alias --- 32,40 ---- def _get_declaration(self): return self._decl ! declaration = property( _get_declaration, ! doc="""The declaration this code creator is based on. ! @type: L{decl_wrapper_t<decl_wrappers.decl_wrapper_t>} ! """) ! def _get_alias(self): return self.declaration.alias *************** *** 30,32 **** def _set_alias(self, alias): self.declaration.alias = alias ! alias = property( _get_alias, _set_alias ) \ No newline at end of file --- 42,44 ---- def _set_alias(self, alias): self.declaration.alias = alias ! alias = property( _get_alias, _set_alias ) Index: __init__.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/__init__.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** __init__.py 28 Feb 2006 07:31:32 -0000 1.23 --- __init__.py 16 Mar 2006 14:48:45 -0000 1.24 *************** *** 4,7 **** --- 4,18 ---- # http://www.boost.org/LICENSE_1_0.txt) + """Code creators. + + This sub-package contains the code creator classes which are nodes in + the code creator tree. This tree represents the entire source code of + the final extension module (even when the source code will later be + distributed among several source files) and each individual code + creator represents a single block of source code. + + The base class for all code creators is L{code_creator_t}. + """ + from code_creator import code_creator_t from compound import compound_t Index: module.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/module.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** module.py 14 Dec 2005 09:09:52 -0000 1.12 --- module.py 16 Mar 2006 14:48:45 -0000 1.13 *************** *** 14,18 **** --- 14,24 ---- class module_t(compound.compound_t): + """This class represents the source code for the entire extension module. + + The root of the code creator tree is always a module_t object. + """ def __init__(self): + """Constructor. + """ compound.compound_t.__init__(self, None) *************** *** 52,56 **** else: return found[0] ! body = property( _get_body ) def _get_license( self ): --- 58,66 ---- else: return found[0] ! body = property( _get_body, ! doc="""A module_body_t object or None. ! @type: L{module_body_t} ! """ ! ) def _get_license( self ): *************** *** 65,71 **** self.remove_creator( self.creators[0] ) self.adopt_creator( license_inst, 0 ) ! license = property( _get_license, _set_license ) def last_include_index(self): for i in range( len(self.creators) - 1, -1, -1 ): if isinstance( self.creators[i], include.include_t ): --- 75,93 ---- self.remove_creator( self.creators[0] ) self.adopt_creator( license_inst, 0 ) ! license = property( _get_license, _set_license, ! doc="""License text. ! ! The license text will always be the first children node. ! @type: str or L{license_t}""") def last_include_index(self): + """Return the children index of the last L{include_t} object. + + An exception is raised when there is no include_t object among + the children creators. + + @returns: Children index + @rtype: int + """ for i in range( len(self.creators) - 1, -1, -1 ): if isinstance( self.creators[i], include.include_t ): *************** *** 75,78 **** --- 97,108 ---- def first_include_index(self): + """Return the children index of the first L{include_t} object. + + An exception is raised when there is no include_t object among + the children creators. + + @returns: Children index + @rtype: int + """ first_include_index = 0 for i in range( len(self.creators) ): *************** *** 84,87 **** --- 114,124 ---- def adopt_include(self, include_creator): + """Insert an L{include_t} object. + + The include creator is inserted right after the last include file. + + @param include_creator: Include creator object + @type include_creator: L{include_t} + """ self.adopt_creator( include_creator, self.last_include_index() + 1 ) *************** *** 133,135 **** code = self.unindent(code) return os.linesep.join( includes ) + 2 * os.linesep + code + os.linesep ! \ No newline at end of file --- 170,172 ---- code = self.unindent(code) return os.linesep.join( includes ) + 2 * os.linesep + code + os.linesep ! |
From: Roman <rom...@us...> - 2006-03-16 06:35:46
|
Update of /cvsroot/pygccxml/source/pyplusplus/examples/py_easybmp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11604/pyplusplus/examples/py_easybmp Modified Files: create_easybmp.py Log Message: updating EasyBMP example to use new interface Index: create_easybmp.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/examples/py_easybmp/create_easybmp.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** create_easybmp.py 28 Feb 2006 07:31:33 -0000 1.11 --- create_easybmp.py 16 Mar 2006 06:35:41 -0000 1.12 *************** *** 8,15 **** from environment import settings from pygccxml import parser - from pygccxml import declarations from pyplusplus import code_creators ! from pyplusplus import module_creator ! from pyplusplus import file_writers --- 8,14 ---- from environment import settings from pygccxml import parser from pyplusplus import code_creators ! from pyplusplus import decl_wrappers ! from pyplusplus import module_builder *************** *** 22,196 **** """ ! def identify_call_policies( decl ): ! """ ! pyplusplus built-in call policies resolver can not and will not guess call ! policies for functions. Nevertheless, it is easy to setup custom call ! policies resolver. The only requirement on custom call policy resolver is ! to be callable, that takes 1 argument - C++ "callable" declaration. It could ! be constructor, member or free function, regular or casting operators. ! ! In this example I reuse built-in call policies resolver, and if it can not ! fiind out call policies I choose call policies based on some fact. ! """ ! built_in_resolver = module_creator.built_in_resolver_t() ! policy = built_in_resolver( decl ) ! if policy: ! return policy ! ! if isinstance( decl, declarations.member_operator_t ) \ ! and decl.symbol == '()' \ ! and decl.parent.name == 'BMP': ! return code_creators.return_internal_reference() ! return None ! ! class easybmp_exporter_t: ! def __init__(self): ! self.__header_file = os.path.join( settings.easybmp_path, 'EasyBMP.h' ) ! ! def read_declarations(self): ! """ ! The first step in creating C++ - Python bindings is to read declarations ! from source files. This step is done by using pygccxml. First thing that ! you should do is to setup parser ( GCC-XML ). pygccxml.parser.config_t ! class is responsible for parser configuration. Basicaly, using config_t ! class you can setup: ! * GCC-XML binary path ! * include directories ! * working directory ! * [un]defined symbols ! See that class definition for more information. ! ! After you setup parser configuration you can read declarations from ! source files. There are 2 declaration readers: ! * pygccxml.parser.source_reader_t ! * pygccxml.parser.project_reader_t ! If you have to parse single file, then use source_reader_t, otherwise ! you'd better use project_reader_t. Please refere to pygccxml documentation ! for full explanation about those classes. ! ! In this example I read all declarations found in EasyBMP.h file and files ! that are included from it. ! """ ! config = parser.config_t( gccxml_path=settings.gccxml_path ! , working_directory=settings.easybmp_path ) ! reader = parser.source_reader_t( config ) ! return reader.read_file( self.__header_file ) ! ! def filter_declarations(self, decls ): ! """ ! After you read declarations, you should leave only declarations, that ! you want to export to Python. I call this process "filtering". There are ! a lot of ways to filter out declarations: ! * by phisical location ! you can specify a list of files and directories, and all declarations ! that are not declared within those files will be removed ! * by namespace ! return declarations.find_declaration( decls ! , name="geometry" ! , type=declarations.namespace_t ) ! * by defining some custom filter ! while defining custom filter, be careful in excluding namespaces, ! because thus you exclude all declarations defined in this namespace.s ! """ ! return declarations.filtering.by_location( decls, [settings.easybmp_path] ) ! def create_extmodule(self, decls): ! """ ! 3'th step. In this step pyplusplus creates "code creators" tree from ! the set of declarations, you want to export. This step creates mapping ! between C++ declaration and instance of the pyplusplus class that will ! create code, needed to export the declaration. ! pyplusplus.module_creator.creator_t class is responsible for this step. ! In most cases you do not need to use this class at all. Instead of ! using this class consider to use pyplusplus.module_creator.create function. ! This function takes 2 arguments: module name and a list of declarations. ! ! In my case I should use this class in order to setup custom call policies ! resolver. creator.create() returns "main" code creator - ! pyplusplus.code_creators.module_t class instance. This code creator keeps ! all other code creators. ! ! This step is the most complex in the whole process. ! """ ! creator = module_creator.creator_t( decls=decls ! , module_name=settings.module_name ! , create_castinig_constructor=True ! , call_policies_resolver_=identify_call_policies) ! return creator.create() ! def customize_extmodule( self, extmodule ): ! """ ! Nobody is perfect, pyplusplus too. After you created ! pyplusplus.code_creators.module_t class instance it's time to do all ! customization on the yet generated code, before you actualy write the ! code to files. ! ! First and most common customization in open source project is to setup ! license. License text will apear as is within every generated file. ! ! Second common customization is to setup include directories. This will ! cause pyplusplus to generate code with relative include directives. ! ! You can also to setup precompiled header. ! ! Almost every code_creator has set of properties that could be changed. ! ! An other cool feature of pyplusplus is namespace aliasing. ! bpalias = code_creators.namespace_alias_t( alias="bp" ! , full_namespace_name="::boost::python") ! extmodule.adopt_creator( bpalias, extmodule.last_include_index() + 1 ) ! All code that will be generated after "namespace bp = ::boost::python;" ! will use "bp" instead of "::boost::python". Nice! ! ! Last and may be the most important thing that you can do at this step ! is to create custom code creators and inject them into right place, within ! module_t code creator instance. Remember: you should be able to modify, ! add or delete almost every piece of yet not generated code. If you are ! not, just send me a mail. ! """ ! global license ! extmodule.license = license ! #butifying include code generation ! extmodule.user_defined_directories.append( settings.easybmp_path ) ! extmodule.precompiled_header = 'boost/python.hpp' ! #Adding EasyBMP.h as first include. It comes because of internal structure of EasyBMP ! extmodule.adopt_creator( code_creators.include_t( header=self.__header_file ), 2 ) ! body_index = extmodule.creators.index( extmodule.body ) ! bmp_call = code_creators.creator_finder.find_by_declaration_single( ! declarations.match_declaration_t( fullname='::BMP::operator()' ) ! , extmodule.body ) ! bmp_call.alias = 'GetRGBAPixel' ! ! def write_files( self, extmodule ): ! """ ! Last step: to create file(s) with generated code. There are few options ! here: ! * you can write all generated code to single file. In this case you ! should specify destination file name. ! pyplusplus.file_writers.write_file function is your friend. It takes ! 2 arguments: ! * pyplusplus.code_creators.module_t instance ! * destination file name ! ! * you can write all generated code to multiple files. In this case ! you should specify destination directory name. In this case pyplusplus ! generates files as recomended here: ! www.boost.org/libs/python/doc/tutorial/doc/html/python/techniques.html#python.reducing_compiling_time ! If you don't like the way I do it, you can always write your own file writer. ! """ ! file_writers.write_file(extmodule ! , os.path.join(settings.generated_files_dir ! , settings.module_name + '.cpp') ) ! ! def create(self): ! decls_all = self.read_declarations() ! decls = self.filter_declarations(decls_all) ! extmodule = self.create_extmodule( decls ) ! self.customize_extmodule( extmodule ) ! self.write_files( extmodule ) ! ! def export(): ! exporter = easybmp_exporter_t() ! exporter.create() if __name__ == '__main__': --- 21,46 ---- """ ! def export(): ! global license ! header_file = os.path.join( settings.easybmp_path, 'EasyBMP.h' ) ! #create configuration for GCC-XML parser ! parser_config = parser.config_t( gccxml_path=settings.gccxml_path ! , working_directory=settings.easybmp_path ) ! #initialize module builder ! mb = module_builder.module_builder_t( settings.module_name ! , [ header_file ] ! , parser_config ) ! bmp_class = mb.class_( 'BMP' ) ! call_operator = bmp_class.operator( symbol='()', recursive=False ) ! call_operator.alias = 'GetRGBAPixel' ! call_operator.call_policies = decl_wrappers.return_internal_reference() ! #customizing code, before generation ! mb.module_creator.license = license ! mb.module_creator.user_defined_directories.append( settings.easybmp_path ) ! mb.module_creator.precompiled_header = 'boost/python.hpp' ! mb.module_creator.adopt_creator( code_creators.include_t( header=header_file ), 2 ) ! mb.write_file( os.path.join( settings.generated_files_dir, settings.module_name + '.cpp') ) if __name__ == '__main__': |
From: Roman <rom...@us...> - 2006-03-16 06:34:19
|
Update of /cvsroot/pygccxml/source/pyplusplus/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11219/pyplusplus/unittests Modified Files: recursive_tester.py regression2_tester.py Log Message: making some test to use cool feature created by Matthias Index: regression2_tester.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/unittests/regression2_tester.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** regression2_tester.py 15 Mar 2006 09:27:07 -0000 1.3 --- regression2_tester.py 16 Mar 2006 06:34:09 -0000 1.4 *************** *** 21,26 **** def customize( self, mb ): ! decls = mb.decls( lambda decl: not isinstance( decl, declarations.namespace_t ) ! and decl.name == 'get_a' ) decls.ignore = True --- 21,27 ---- def customize( self, mb ): ! matcher = ~declarations.namespace_matcher_t() ! matcher = matcher & declarations.declaration_matcher_t( name='get_a' ) ! decls = mb.decls( matcher ) decls.ignore = True Index: recursive_tester.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/unittests/recursive_tester.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** recursive_tester.py 15 Mar 2006 09:27:07 -0000 1.3 --- recursive_tester.py 16 Mar 2006 06:34:09 -0000 1.4 *************** *** 21,26 **** def customize( self, mb ): ! decls = mb.decls( lambda decl: not isinstance(decl, declarations.namespace_t) ! and 'skip' in decl.name ) decls.ignore = True --- 21,28 ---- def customize( self, mb ): ! matcher = ~declarations.namespace_matcher_t() ! matcher = matcher & declarations.regex_matcher_t( '.*skip.*' ) ! ! decls = mb.decls( matcher ) decls.ignore = True |
From: Roman <rom...@us...> - 2006-03-16 06:31:35
|
Update of /cvsroot/pygccxml/source/pygccxml/unittests/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10238/pygccxml/unittests/data Modified Files: core_cache.hpp Log Message: adding [or|and|not]_matcher_t classes and test cases to pygccxml Index: core_cache.hpp =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/unittests/data/core_cache.hpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** core_cache.hpp 15 Mar 2006 09:27:06 -0000 1.46 --- core_cache.hpp 16 Mar 2006 06:31:29 -0000 1.47 *************** *** 24,26 **** ! //touch//touch//touch//touch//touch//touch//touch//touch//touch \ No newline at end of file --- 24,26 ---- ! //touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch \ No newline at end of file |
From: Roman <rom...@us...> - 2006-03-16 06:31:32
|
Update of /cvsroot/pygccxml/source/pygccxml/declarations In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10238/pygccxml/declarations Modified Files: __init__.py filters.py Log Message: adding [or|and|not]_matcher_t classes and test cases to pygccxml Index: __init__.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/__init__.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** __init__.py 15 Mar 2006 09:27:06 -0000 1.36 --- __init__.py 16 Mar 2006 06:31:29 -0000 1.37 *************** *** 135,138 **** --- 135,142 ---- from decl_factory import decl_factory_t + from filters import matcher_base_t + from filters import or_matcher_t + from filters import and_matcher_t + from filters import not_matcher_t from filters import declaration_matcher_t from filters import calldef_matcher_t Index: filters.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/filters.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** filters.py 15 Mar 2006 09:27:06 -0000 1.3 --- filters.py 16 Mar 2006 06:31:29 -0000 1.4 *************** *** 15,20 **** from pygccxml import utils ! class declaration_matcher_t( object ): def __init__( self, *args, **keywds ): """ --- 15,71 ---- from pygccxml import utils + class matcher_base_t(object): + def __init__( self ): + object.__init__( self ) + + def __call__(self, decl): + raise NotImplementedError( "matcher must always implement the __call__() method." ) ! def __invert__(self): ! """not-operator (~)""" ! return not_matcher_t(self) ! ! def __and__(self, other): ! """and-operator (&)""" ! return and_matcher_t([self, other]) ! ! def __or__(self, other): ! """or-operator (|)""" ! return or_matcher_t([self, other]) ! ! class and_matcher_t(matcher_base_t): ! """Combine several other filters with "and".""" ! def __init__(self, matchers): ! matcher_base_t.__init__(self) ! self.matchers = matchers ! ! def __call__(self, decl): ! for matcher in self.matchers: ! if not matcher(decl): ! return False ! return True ! ! class or_matcher_t(matcher_base_t): ! """Combine several other filters with "or".""" ! def __init__(self, matchers): ! matcher_base_t.__init__(self) ! self.matchers = matchers ! ! def __call__(self, decl): ! for matcher in self.matchers: ! if matcher(decl): ! return True ! return False ! ! class not_matcher_t(matcher_base_t): ! """Combine several other filters with "or".""" ! def __init__(self, matcher): ! matcher_base_t.__init__(self) ! self.matcher = matcher ! ! def __call__(self, decl): ! return not self.matcher(decl) ! ! class declaration_matcher_t( matcher_base_t ): def __init__( self, *args, **keywds ): """ *************** *** 30,34 **** #But I think this is just wrong, because abspath wbuilds path using #cwd and this behaviour is fragile and not so easy to find the bug. ! object.__init__( self ) self.decl_type = keywds.get('decl_type', None) self.name = keywds.get('name', None) --- 81,85 ---- #But I think this is just wrong, because abspath wbuilds path using #cwd and this behaviour is fragile and not so easy to find the bug. ! matcher_base_t.__init__( self ) self.decl_type = keywds.get('decl_type', None) self.name = keywds.get('name', None) *************** *** 74,78 **** type could be string or instance of class derived from cpptypes.type_t """ ! keywds.update(decl_type=variable.variable_t) declaration_matcher_t.__init__( self, *args, **keywds ) self.type = keywds.get('type', None) --- 125,129 ---- type could be string or instance of class derived from cpptypes.type_t """ ! keywds['decl_type'] = variable.variable_t declaration_matcher_t.__init__( self, *args, **keywds ) self.type = keywds.get('type', None) *************** *** 93,97 **** class namespace_matcher_t( declaration_matcher_t ): def __init__( self, *args, **keywds ): ! keywds.update(decl_type=namespace.namespace_t) declaration_matcher_t.__init__( self, namespace.namespace_t, *args, **keywds) --- 144,148 ---- class namespace_matcher_t( declaration_matcher_t ): def __init__( self, *args, **keywds ): ! keywds['decl_type'] = namespace.namespace_t declaration_matcher_t.__init__( self, namespace.namespace_t, *args, **keywds) *************** *** 114,118 **** """ if not keywds.has_key( 'decl_type' ): ! keywds.update( decl_type=calldef.calldef_t ) declaration_matcher_t.__init__( self, *args, **keywds ) --- 165,169 ---- """ if not keywds.has_key( 'decl_type' ): ! keywds[ 'decl_type' ] = calldef.calldef_t declaration_matcher_t.__init__( self, *args, **keywds ) *************** *** 149,155 **** class operator_matcher_t( calldef_matcher_t ): ! def __init__( self, symbol=None, *args, **keywds): if not keywds.has_key( 'decl_type' ): ! keywds.update( decl_type=calldef.operator_t ) calldef_matcher_t.__init__( self, *args, **keywds ) self.symbol = keywds.get( 'symbol', None ) --- 200,206 ---- class operator_matcher_t( calldef_matcher_t ): ! def __init__( self, *args, **keywds): if not keywds.has_key( 'decl_type' ): ! keywds['decl_type'] = calldef.operator_t calldef_matcher_t.__init__( self, *args, **keywds ) self.symbol = keywds.get( 'symbol', None ) *************** *** 160,167 **** return None != self.symbol and self.symbol == decl.symbol ! class regex_matcher_t: ! def __init__( self, regex, function ): self.regex = re.compile( regex ) self.function = function def __call__( self, decl ): --- 211,221 ---- return None != self.symbol and self.symbol == decl.symbol ! class regex_matcher_t( matcher_base_t ): ! def __init__( self, regex, function=None ): ! matcher_base_t.__init__(self) self.regex = re.compile( regex ) self.function = function + if None is self.function: + self.function = lambda decl: decl.name def __call__( self, decl ): *************** *** 169,174 **** return bool( self.regex.match( text ) ) ! class access_type_matcher_t: def __init__( self, access_type ): self.access_type = access_type --- 223,229 ---- return bool( self.regex.match( text ) ) ! class access_type_matcher_t( matcher_base_t ): def __init__( self, access_type ): + matcher_base_t.__init__( self ) self.access_type = access_type |
From: Roman <rom...@us...> - 2006-03-16 06:31:32
|
Update of /cvsroot/pygccxml/source/pygccxml/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10238/pygccxml/unittests Modified Files: filters_tester.py Log Message: adding [or|and|not]_matcher_t classes and test cases to pygccxml Index: filters_tester.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/unittests/filters_tester.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** filters_tester.py 2 Mar 2006 05:53:15 -0000 1.1 --- filters_tester.py 16 Mar 2006 06:31:29 -0000 1.2 *************** *** 34,38 **** --- 34,57 ---- public_members = declarations.matcher.find( criteria, self.declarations ) self.failUnless( 19 == len( public_members ) ) + + def test_or_matcher( self ): + criteria1 = declarations.regex_matcher_t( 'oper.*' + , lambda decl: decl.name ) + criteria2 = declarations.access_type_matcher_t( declarations.ACCESS_TYPES.PUBLIC ) + found = declarations.matcher.find( criteria1 | criteria2, self.declarations ) + self.failUnless( 19 <= len( found ) <= 25 ) + def test_and_matcher( self ): + criteria1 = declarations.regex_matcher_t( 'oper.*' + , lambda decl: decl.name ) + criteria2 = declarations.access_type_matcher_t( declarations.ACCESS_TYPES.PUBLIC ) + found = declarations.matcher.find( criteria1 & criteria2, self.declarations ) + self.failUnless( len( found ) <= 6 ) + + def test_not_matcher( self ): + criteria1 = declarations.regex_matcher_t( 'oper.*' + , lambda decl: decl.name ) + found = declarations.matcher.find( ~( ~criteria1 ), self.declarations ) + self.failUnless( len( found ) == 6 ) def create_suite(): |