pygccxml-commit Mailing List for C++ Python language bindings (Page 58)
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: <rom...@us...> - 2006-08-17 03:42:41
|
Revision: 416 Author: roman_yakovenko Date: 2006-08-16 20:42:32 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=416&view=rev Log Message: ----------- removing white space Modified Paths: -------------- index.rest Modified: index.rest =================================================================== --- index.rest 2006-08-17 03:36:58 UTC (rev 415) +++ index.rest 2006-08-17 03:42:32 UTC (rev 416) @@ -8,9 +8,9 @@ pygccxml package ---------------- -* Do you need to parse C++ code? +* Do you need to parse C++ code? * Do you need to build code generator? -* Do you need to create UML diagram? +* Do you need to create UML diagram? `pygccxml`_ is the way to go! `Learn more`__. @@ -19,14 +19,12 @@ ------------ Py++ package ------------ - -"I love deadlines. I love the whooshing noise they make as they go by." - - -- Douglas Adams - -Meet your deadlines with powerful code generator engine - `Py++`_. - -`Py++`_ package and `Boost.Python`_ library provide a complete solution for + +"I love deadlines. I love the whooshing noise they make as they go by." + -- Douglas Adams + +Meet your deadlines with powerful code generator engine - `Py++`_. +`Py++`_ package and `Boost.Python`_ library provide a complete solution for interfacing Python and C++. `Learn more`_. .. _`Learn more` : `Py++`_ @@ -38,14 +36,14 @@ `Boost`_ provides free peer-reviewed portable C++ source libraries. `pyboost`_ package export next libraries to Python: - * `Boost.Date_Time`_ - date time library designed to provide a basis for + * `Boost.Date_Time`_ - date time library designed to provide a basis for performing efficient time calculations * `Boost.CRC`_ - cyclic redundancy code computation objects * `Boost.Rational`_ - rational number class * `Boost.Random`_ - a complete system for random number generation Python bindings for `boost.graph`_ library is also available from -http://www.osl.iu.edu/~dgregor/bgl-python . +http://www.osl.iu.edu/~dgregor/bgl-python . ------------- pydsc package @@ -62,9 +60,11 @@ `EasyBMP`_ could be easier? Yes of course! Learn more about `EasyBMP Python bindings`_. .. _`EasyBMP Python bindings`: ./pyplusplus/examples/easybmp/easybmp.html - -.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html + +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html + + .. _`pyboost` : ./pyplusplus/examples/boost/boost.html .. _`boost.graph` : http://www.boost.org/libs/graph/doc/table_of_contents.html .. _`boost.date_time` : http://boost.org/doc/html/date_time.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-17 03:37:06
|
Revision: 415 Author: roman_yakovenko Date: 2006-08-16 20:36:58 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=415&view=rev Log Message: ----------- improving filter interface Modified Paths: -------------- pydsc_dev/pydsc/pydsc.py Modified: pydsc_dev/pydsc/pydsc.py =================================================================== --- pydsc_dev/pydsc/pydsc.py 2006-08-16 18:24:58 UTC (rev 414) +++ pydsc_dev/pydsc/pydsc.py 2006-08-17 03:36:58 UTC (rev 415) @@ -83,27 +83,52 @@ """return os.path.normcase( os.path.normpath( some_path ) )""" return os.path.normcase( os.path.normpath( some_path ) ) -def contains_parent_dir( path, dirs ): - """ - returns true if one of the directories is root directory for the path, - false otherwise +class filter_by_path_t: + class FILTER_TYPE: + """defines few filter constants""" + INCLUDE = 'include' + EXCLUDE = 'exclude' - @param path: path - @type path: str + def __init__( self, what, ftype ): + self.what = what + if None is self.what: + self.what = [] + elif isinstance( self.what, str ): + self.what = [self.what] + self.what = map( normalize_path, self.what ) + self.ftype = ftype - @param dirs: list of directories and\\or files - @type dirs: [ str ] + @staticmethod + def contains_parent_dir( path, dirs ): + """ + returns true if one of the directories is root directory for the path, + false otherwise - @return: bool - """ - #precondition: dirs and fpath should be normalize_path'ed before calling this function - return bool( filter( lambda dir: path.startswith( dir ), dirs ) ) + @param path: path + @type path: str -class FILTER_TYPE: - """defines few filter constants""" - INCLUDE = 'include' - EXCLUDE = 'exclude' + @param dirs: list of directories and\\or files + @type dirs: [ str ] + @return: bool + """ + #precondition: dirs and fpath should be normalize_path'ed before calling this function + return bool( filter( lambda dir: path.startswith( dir ), dirs ) ) + + def check( self, source_file ): + source_file = normalize_path( source_file ) + if source_file in self.what or self.contains_parent_dir( source_file, self.what ): + return self.ftype == self.FILTER_TYPE.INCLUDE + else: + return self.ftype == self.FILTER_TYPE.EXCLUDE + +def exclude( what ): + return filter_by_path_t( what, filter_t.FILTER_TYPE.EXCLUDE ) + +def include( what ): + return filter_by_path_t( what, filter_t.FILTER_TYPE.INCLUDE ) + + class checker_t( object ): """ applies spell check process on every imported module @@ -119,7 +144,6 @@ , speller , writer=None , filter=None - , filter_type=None , ignore_identifiers=True ): """ initialization method @@ -157,11 +181,6 @@ if self.writer is None: self.writer = sys.stdout self.filter = filter - if self.filter is None: - self.filter = [] - self.filter_type = None - if self.filter_type is None: - self.filter_type = FILTER_TYPE.EXCLUDE self.identifiers = set() self.ignore_identifiers = ignore_identifiers @@ -173,18 +192,16 @@ if inspect.ismodule( obj ): if obj.__name__ in self.__already_imported: return False #do not check already imported modules - try: - source_file = inspect.getsourcefile(obj) - if source_file is None: - source_file = inspect.getfile( obj ) - source_file = normalize_path( source_file ) - if source_file in self.filter \ - or contains_parent_dir( source_file, self.filter ): - return self.filter_type == FILTER_TYPE.INCLUDE - else: - return self.filter_type == FILTER_TYPE.EXCLUDE - except TypeError: - return False #built in module + if self.filter: + try: + source_file = inspect.getsourcefile(obj) + if source_file is None: + source_file = inspect.getfile( obj ) + return self.filter.check( source_file ) + except TypeError: + return False #built in module + else: + return True obj_module = inspect.getmodule( obj ) if not obj_module is module: return False @@ -198,7 +215,6 @@ return False def import_( self, name, globals=None, locals=None, fromlist=None ): - self.filter = map( normalize_path, self.filter ) pymodule = self.__orig_import( name, globals, locals, fromlist ) if self.should_be_checked(pymodule): #write = self.writer.write This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-16 18:31:05
|
Revision: 414 Author: roman_yakovenko Date: 2006-08-16 11:24:58 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=414&view=rev Log Message: ----------- replacing LF with CRLF Modified Paths: -------------- developer_scripts/clean_source_dir.py developer_scripts/file_system_iter.py pydsc_dev/setup.py pydsc_dev/unittests/tester.py pydsc_dev/unittests/to_be_tested.py pygccxml_dev/docs/apidocs/www_configuration.py pygccxml_dev/docs/download.rest pygccxml_dev/docs/example/example.py pygccxml_dev/docs/www_configuration.py pygccxml_dev/pygccxml/__init__.py pygccxml_dev/pygccxml/declarations/__init__.py pygccxml_dev/pygccxml/declarations/algorithm.py pygccxml_dev/pygccxml/declarations/call_invocation.py pygccxml_dev/pygccxml/declarations/calldef.py pygccxml_dev/pygccxml/declarations/class_declaration.py pygccxml_dev/pygccxml/declarations/cpptypes.py pygccxml_dev/pygccxml/declarations/decl_factory.py pygccxml_dev/pygccxml/declarations/decl_printer.py pygccxml_dev/pygccxml/declarations/decl_visitor.py pygccxml_dev/pygccxml/declarations/declaration.py pygccxml_dev/pygccxml/declarations/enumeration.py pygccxml_dev/pygccxml/declarations/filtering.py pygccxml_dev/pygccxml/declarations/matcher.py pygccxml_dev/pygccxml/declarations/matchers.py pygccxml_dev/pygccxml/declarations/mdecl_wrapper.py pygccxml_dev/pygccxml/declarations/namespace.py pygccxml_dev/pygccxml/declarations/pattern_parser.py pygccxml_dev/pygccxml/declarations/templates.py pygccxml_dev/pygccxml/declarations/type_traits.py pygccxml_dev/pygccxml/declarations/type_visitor.py pygccxml_dev/pygccxml/declarations/typedef.py pygccxml_dev/pygccxml/declarations/variable.py pygccxml_dev/pygccxml/parser/__init__.py pygccxml_dev/pygccxml/parser/config.py pygccxml_dev/pygccxml/parser/declarations_cache.py pygccxml_dev/pygccxml/parser/directory_cache.py pygccxml_dev/pygccxml/parser/linker.py pygccxml_dev/pygccxml/parser/patcher.py pygccxml_dev/pygccxml/parser/project_reader.py pygccxml_dev/pygccxml/parser/scanner.py pygccxml_dev/pygccxml/utils/__init__.py pygccxml_dev/setup.py pygccxml_dev/unittests/autoconfig.py pygccxml_dev/unittests/bit_fields_tester.py pygccxml_dev/unittests/cache_enums_tester.py pygccxml_dev/unittests/cached_source_file_tester.py pygccxml_dev/unittests/call_invocation_tester.py pygccxml_dev/unittests/calldef_matcher_tester.py pygccxml_dev/unittests/complex_types_tester.py pygccxml_dev/unittests/core_tester.py pygccxml_dev/unittests/decl_printer_tester.py pygccxml_dev/unittests/declarations_cache_tester.py pygccxml_dev/unittests/declarations_tester.py pygccxml_dev/unittests/demangled_tester.py pygccxml_dev/unittests/file_cache_tester.py pygccxml_dev/unittests/filtering_tester.py pygccxml_dev/unittests/filters_tester.py pygccxml_dev/unittests/has_binary_operator_traits_tester.py pygccxml_dev/unittests/hierarchy_traveling.py pygccxml_dev/unittests/namespace_matcher_tester.py pygccxml_dev/unittests/parser_test_case.py pygccxml_dev/unittests/patcher_tester.py pygccxml_dev/unittests/profile_parser.py pygccxml_dev/unittests/start_with_declarations_tester.py pygccxml_dev/unittests/string_traits_tester.py pygccxml_dev/unittests/templates_tester.py pygccxml_dev/unittests/test_all.py pygccxml_dev/unittests/test_performance.py pygccxml_dev/unittests/timeit_test_parser.py pygccxml_dev/unittests/type_traits_tester.py pygccxml_dev/unittests/typedefs_tester.py pygccxml_dev/unittests/unnamed_classes_tester.py pygccxml_dev/unittests/unnamed_enums_bug_tester.py pygccxml_dev/unittests/variable_matcher_tester.py pygccxml_dev/unittests/vector_traits_tester.py pyplusplus_dev/contrib/arrayinfo/arrayinfo.py pyplusplus_dev/contrib/arrayinfo/cpptokenize.py pyplusplus_dev/contrib/arrayinfo/createarrayinfo.py pyplusplus_dev/contrib/pypp_api/generate_docs.py pyplusplus_dev/contrib/pypp_api/pypp_api/__init__.py pyplusplus_dev/contrib/pypp_api/pypp_api/argpolicy.py pyplusplus_dev/contrib/pypp_api/pypp_api/decltypes.py pyplusplus_dev/contrib/pypp_api/pypp_api/declwrapper.py pyplusplus_dev/contrib/pypp_api/pypp_api/filters.py pyplusplus_dev/contrib/pypp_api/pypp_api/modulebuilder.py pyplusplus_dev/contrib/pypp_api/pypp_api/selection.py pyplusplus_dev/contrib/pypp_api/pypp_api/treerange.py pyplusplus_dev/docs/comparisons/www_configuration.py pyplusplus_dev/docs/definition.rest pyplusplus_dev/docs/documentation/apidocs/www_configuration.py pyplusplus_dev/docs/documentation/www_configuration.py pyplusplus_dev/docs/download.rest pyplusplus_dev/docs/examples/boost/www_configuration.py pyplusplus_dev/docs/osdc2006/generate_docs.py pyplusplus_dev/docs/osdc2006/presentation-talk.rest pyplusplus_dev/docs/peps/www_configuration.py pyplusplus_dev/examples/custom_code_creator/generate_code.py pyplusplus_dev/examples/custom_code_creator/unittests/test_all.py pyplusplus_dev/examples/pyboost_dev/crc_example.py pyplusplus_dev/examples/pyboost_dev/date_time_example.py pyplusplus_dev/examples/pyboost_dev/dev/boost_random/random_settings.py pyplusplus_dev/examples/pyboost_dev/dev/crc/crc_settings.py pyplusplus_dev/examples/pyboost_dev/dev/crc/generate_code.py pyplusplus_dev/examples/pyboost_dev/dev/date_time/customization_data.py pyplusplus_dev/examples/pyboost_dev/dev/date_time/date_time_settings.py pyplusplus_dev/examples/pyboost_dev/dev/date_time/generate_code.py pyplusplus_dev/examples/pyboost_dev/dev/rational/generate_code.py pyplusplus_dev/examples/pyboost_dev/dev/rational/rational_settings.py pyplusplus_dev/examples/pyboost_dev/pyboost/__init__.py pyplusplus_dev/examples/pyboost_dev/pyboost/boost_random/__init__.py pyplusplus_dev/examples/pyboost_dev/pyboost/crc/__init__.py pyplusplus_dev/examples/pyboost_dev/pyboost/date_time/__init__.py pyplusplus_dev/examples/pyboost_dev/pyboost/rational/__init__.py pyplusplus_dev/examples/pyboost_dev/random_example.py pyplusplus_dev/examples/pyboost_dev/rational_example.py pyplusplus_dev/examples/pyboost_dev/unittestst/boost_random/test_all.py pyplusplus_dev/examples/pyboost_dev/unittestst/crc/test_all.py pyplusplus_dev/examples/pyboost_dev/unittestst/date_time/examples.py pyplusplus_dev/examples/pyboost_dev/unittestst/date_time/gregorian_tester.py pyplusplus_dev/examples/pyboost_dev/unittestst/date_time/local_time_tester.py pyplusplus_dev/examples/pyboost_dev/unittestst/date_time/posix_time_tester.py pyplusplus_dev/examples/pyboost_dev/unittestst/date_time/test_all.py pyplusplus_dev/examples/pyboost_dev/unittestst/rational/test_all.py pyplusplus_dev/examples/pyboost_dev/unittestst/test_all.py pyplusplus_dev/examples/pyeasybmp_dev/pyeasybmp/build_setup.py pyplusplus_dev/examples/pyeasybmp_dev/pyeasybmp/environment.py pyplusplus_dev/examples/pyeasybmp_dev/pyeasybmp/generate_code.py pyplusplus_dev/examples/pyeasybmp_dev/unittests/grayscale.py pyplusplus_dev/pyplusplus/__init__.py pyplusplus_dev/pyplusplus/_logging_/__init__.py pyplusplus_dev/pyplusplus/_logging_/multi_line_formatter.py pyplusplus_dev/pyplusplus/code_creators/__init__.py pyplusplus_dev/pyplusplus/code_creators/algorithm.py pyplusplus_dev/pyplusplus/code_creators/array_1_registrator.py pyplusplus_dev/pyplusplus/code_creators/calldef.py pyplusplus_dev/pyplusplus/code_creators/class_declaration.py pyplusplus_dev/pyplusplus/code_creators/code_creator.py pyplusplus_dev/pyplusplus/code_creators/compound.py pyplusplus_dev/pyplusplus/code_creators/custom.py pyplusplus_dev/pyplusplus/code_creators/declaration_based.py pyplusplus_dev/pyplusplus/code_creators/enum.py pyplusplus_dev/pyplusplus/code_creators/global_variable.py pyplusplus_dev/pyplusplus/code_creators/include.py pyplusplus_dev/pyplusplus/code_creators/include_directories.py pyplusplus_dev/pyplusplus/code_creators/indexing_suites.py pyplusplus_dev/pyplusplus/code_creators/instruction.py pyplusplus_dev/pyplusplus/code_creators/license.py pyplusplus_dev/pyplusplus/code_creators/member_variable.py pyplusplus_dev/pyplusplus/code_creators/module.py pyplusplus_dev/pyplusplus/code_creators/module_body.py pyplusplus_dev/pyplusplus/code_creators/namespace.py pyplusplus_dev/pyplusplus/code_creators/scoped.py pyplusplus_dev/pyplusplus/code_creators/smart_pointers.py pyplusplus_dev/pyplusplus/code_creators/target_configuration.py pyplusplus_dev/pyplusplus/code_creators/unnamed_enum.py pyplusplus_dev/pyplusplus/code_repository/__init__.py pyplusplus_dev/pyplusplus/code_repository/array_1.py pyplusplus_dev/pyplusplus/decl_wrappers/__init__.py pyplusplus_dev/pyplusplus/decl_wrappers/algorithm.py pyplusplus_dev/pyplusplus/decl_wrappers/call_policies.py pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper_printer.py pyplusplus_dev/pyplusplus/decl_wrappers/enumeration_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite1.py pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite2.py pyplusplus_dev/pyplusplus/decl_wrappers/namespace_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/scopedef_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/typedef_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/user_text.py pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py pyplusplus_dev/pyplusplus/file_writers/__init__.py pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py pyplusplus_dev/pyplusplus/file_writers/multiple_files.py pyplusplus_dev/pyplusplus/file_writers/single_file.py pyplusplus_dev/pyplusplus/file_writers/writer.py pyplusplus_dev/pyplusplus/gui/__init__.py pyplusplus_dev/pyplusplus/gui/freeze.py pyplusplus_dev/pyplusplus/gui/ui.py pyplusplus_dev/pyplusplus/gui/ui_runner.py pyplusplus_dev/pyplusplus/gui/wizard.py pyplusplus_dev/pyplusplus/module_builder/__init__.py pyplusplus_dev/pyplusplus/module_builder/builder.py pyplusplus_dev/pyplusplus/module_builder/call_policies.py pyplusplus_dev/pyplusplus/module_creator/__init__.py pyplusplus_dev/pyplusplus/module_creator/call_policies_resolver.py pyplusplus_dev/pyplusplus/module_creator/class_organizer.py pyplusplus_dev/pyplusplus/module_creator/creator.py pyplusplus_dev/pyplusplus/module_creator/types_database.py pyplusplus_dev/pyplusplus/utils/__init__.py pyplusplus_dev/setup.py pyplusplus_dev/tutorials/module_builder/generate_code.py pyplusplus_dev/unittests/__init__.py pyplusplus_dev/unittests/abstract_classes_tester.py pyplusplus_dev/unittests/abstract_tester.py pyplusplus_dev/unittests/algorithms_tester.py pyplusplus_dev/unittests/autoconfig.py pyplusplus_dev/unittests/call_policies_tester.py pyplusplus_dev/unittests/casting_tester.py pyplusplus_dev/unittests/class_order2_tester.py pyplusplus_dev/unittests/class_order3_tester.py pyplusplus_dev/unittests/class_order4_tester.py pyplusplus_dev/unittests/class_order_tester.py pyplusplus_dev/unittests/classes_tester.py pyplusplus_dev/unittests/cppexceptions_tester.py pyplusplus_dev/unittests/default_args_tester.py pyplusplus_dev/unittests/dwrapper_printer_tester.py pyplusplus_dev/unittests/enums_tester.py pyplusplus_dev/unittests/factory_tester.py pyplusplus_dev/unittests/finalizables_tester.py pyplusplus_dev/unittests/free_function_ignore_bug_tester.py pyplusplus_dev/unittests/free_functions_tester.py pyplusplus_dev/unittests/free_operators_tester.py pyplusplus_dev/unittests/fundamental_tester_base.py pyplusplus_dev/unittests/global_variables_tester.py pyplusplus_dev/unittests/gui_tester.py pyplusplus_dev/unittests/gui_wizard_tester.py pyplusplus_dev/unittests/hierarchy3_tester.py pyplusplus_dev/unittests/index_operator_tester.py pyplusplus_dev/unittests/indexing_suites2_tester.py pyplusplus_dev/unittests/indexing_suites_tester.py pyplusplus_dev/unittests/internal_classes_tester.py pyplusplus_dev/unittests/mdecl_wrapper_tester.py pyplusplus_dev/unittests/mem_fun_with_exception_tester.py pyplusplus_dev/unittests/member_functions_tester.py pyplusplus_dev/unittests/member_variables_tester.py pyplusplus_dev/unittests/module_body_tester.py pyplusplus_dev/unittests/module_properties_tester.py pyplusplus_dev/unittests/namespaces_tester.py pyplusplus_dev/unittests/noncopyable_tester.py pyplusplus_dev/unittests/operators_bug_tester.py pyplusplus_dev/unittests/operators_tester.py pyplusplus_dev/unittests/optional_bug_tester.py pyplusplus_dev/unittests/optional_tester.py pyplusplus_dev/unittests/pointer_as_arg_tester.py pyplusplus_dev/unittests/pointer_to_function_as_argument.py pyplusplus_dev/unittests/private_assign_tester.py pyplusplus_dev/unittests/protected_tester.py pyplusplus_dev/unittests/recursive_tester.py pyplusplus_dev/unittests/regression1_tester.py pyplusplus_dev/unittests/regression2_tester.py pyplusplus_dev/unittests/regression3_tester.py pyplusplus_dev/unittests/smart_pointers_tester.py pyplusplus_dev/unittests/special_operators_tester.py pyplusplus_dev/unittests/statics_tester.py pyplusplus_dev/unittests/temporary_variable_tester.py pyplusplus_dev/unittests/test_all.py pyplusplus_dev/unittests/tnfox_bugs_tester.py pyplusplus_dev/unittests/unnamed_classes_tester.py pyplusplus_dev/unittests/unnamed_enums_tester.py pyplusplus_dev/unittests/user_text_tester.py pyplusplus_dev/unittests/vector3_tester.py Modified: developer_scripts/clean_source_dir.py =================================================================== --- developer_scripts/clean_source_dir.py 2006-08-16 12:44:41 UTC (rev 413) +++ developer_scripts/clean_source_dir.py 2006-08-16 18:24:58 UTC (rev 414) @@ -1,25 +1,25 @@ -# 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 -from file_system_iter import files_iterator, folders_iterator - -to_be_deleted_file_exts = [ - '*.pyc' - , '*.py~' - , '*.so' - , '*.os' - , '*.cpp~' - , '*.hpp~' - , '*.dll' - , '*.obj' - , '*.a' - , '*.def' - , '*.exp' - , '*.lib' - , '*.scons' +# 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 +from file_system_iter import files_iterator, folders_iterator + +to_be_deleted_file_exts = [ + '*.pyc' + , '*.py~' + , '*.so' + , '*.os' + , '*.cpp~' + , '*.hpp~' + , '*.dll' + , '*.obj' + , '*.a' + , '*.def' + , '*.exp' + , '*.lib' + , '*.scons' , '*.bak' , '*.pdb' , '*.htm' @@ -27,19 +27,19 @@ , '*.pdb' , '*.dat' , '*.ncb' -] - -to_be_deleted_files = [ '.sconsign' ] - -if __name__ == '__main__': - sources_dir = os.path.join( os.path.abspath( os.curdir ), '..' ) - - for file in files_iterator( sources_dir, to_be_deleted_file_exts ): - print 'removing : ', file - os.remove( file ) - - for file in files_iterator( sources_dir ): - if os.path.split( file )[1] in to_be_deleted_files: - print 'removing : ', file - os.remove( file ) +] + +to_be_deleted_files = [ '.sconsign' ] + +if __name__ == '__main__': + sources_dir = os.path.join( os.path.abspath( os.curdir ), '..' ) + for file in files_iterator( sources_dir, to_be_deleted_file_exts ): + print 'removing : ', file + os.remove( file ) + + for file in files_iterator( sources_dir ): + if os.path.split( file )[1] in to_be_deleted_files: + print 'removing : ', file + os.remove( file ) + \ No newline at end of file Modified: developer_scripts/file_system_iter.py =================================================================== --- developer_scripts/file_system_iter.py 2006-08-16 12:44:41 UTC (rev 413) +++ developer_scripts/file_system_iter.py 2006-08-16 18:24:58 UTC (rev 414) @@ -1,141 +1,141 @@ -# 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 -from types import * - -##If you want include files that doesn't have extension then use filter like '*.' - -def _make_list( argument ): - if type(argument) in StringTypes: - if argument: - return [argument] - else: - return [] - elif type(argument) is ListType: - return argument - else: - raise TypeError( 'Argument "%s" must be or list of strings or string.' % argument ) - -class base_files_iterator: - def __init__(self, file_exts, is_include_exts = True): - self.__file_exts = _make_list( file_exts ) - self.__is_include_exts = is_include_exts - - def _is_to_skip(self, file_path): - if not self.__file_exts: - return 0 - file_ext = os.path.splitext( file_path )[1] - if not file_ext: - file_ext = '.' + file_ext - file_ext = '*' + file_ext - if file_ext.lower() in self.__file_exts: - return not self.__is_include_exts - else: - return self.__is_include_exts - - def _subfolders_and_files(self, folder_path): - files, folders = [], [] - folder_contents = os.listdir(folder_path) - for object_name in folder_contents: - object_path = os.path.join(folder_path, object_name) - if os.path.isfile( object_path ) and not self._is_to_skip( object_path ): - files.append( object_path ) - elif os.path.isdir( object_path ): - folders.append( object_path ) - else: - pass - return folders, files - - def __iter__(self): - raise NotImplementedError - - def next(self): - raise NotImplementedError - - def restart(self): - raise NotImplementedError - -class files_iterator_generator(base_files_iterator): - def __init__(self, folders, file_ext_filter = '', is_include_filter = True, is_recursive = True): - base_files_iterator.__init__(self, file_ext_filter, is_include_filter) - self.__folders = _make_list( folders ) - self.__is_recursive = is_recursive - self.__file_generator = None - - def __walk(self): - folders = self.__folders[:] - while folders: - sub_folders, files = self._subfolders_and_files( folders.pop(0) ) - if self.__is_recursive: - for folder in sub_folders: - folders.append( folder ) - for file_os in files: - yield file_os - - def __iter__(self): - self.__file_generator = self.__walk() - return self - - def next(self): - return self.__file_generator.next() - - def restart(self): - self.__file_generator = None - - -class folders_iterator_generator: - def __init__(self, folders, is_recursive = 1): - self.__folders = [] - for root in _make_list( folders ): - self.__folders.extend( self.__sub_folders( root ) ) - self.__is_recursive = is_recursive - self.__folder_generator = None - - def __sub_folders(self, folder_path): - sub_folders = [] - folder_contains = os.listdir(folder_path) - for object_in_folder in folder_contains: - full_path = os.path.join(folder_path, object_in_folder) - if os.path.isdir( full_path ): - sub_folders.append( full_path ) - return sub_folders - - def __walk(self): - folders = self.__folders[:] - for curr_folder in folders: - yield curr_folder - if self.__is_recursive: - for f in folders_iterator_generator( [curr_folder], True ): - yield f - - def __iter__(self): - self.__folder_generator = self.__walk() - return self - - def next(self): - return self.__folder_generator.next() - - def restart(self): - self.__folder_generator = None - -#preserving backward computability names -file_iter = files_iterator_generator -folder_iter = folders_iterator_generator -#new names -files_iterator = files_iterator_generator -folders_iterator = folders_iterator_generator - -if '__main__' == __name__: - #lFileCount = 0 - #for file_os in files_iterator( r'C:\Program Files\Microsoft Visual Studio\VC98\Include\stlport', ['*.h', '*.'], True, False): - #print file_os - #lFileCount += 1 - #print lFileCount - - for folder in folders_iterator( '/home/roman/language-binding', False ): - print folder - for folder in folders_iterator( '/home/roman/language-binding', True ): +# 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 +from types import * + +##If you want include files that doesn't have extension then use filter like '*.' + +def _make_list( argument ): + if type(argument) in StringTypes: + if argument: + return [argument] + else: + return [] + elif type(argument) is ListType: + return argument + else: + raise TypeError( 'Argument "%s" must be or list of strings or string.' % argument ) + +class base_files_iterator: + def __init__(self, file_exts, is_include_exts = True): + self.__file_exts = _make_list( file_exts ) + self.__is_include_exts = is_include_exts + + def _is_to_skip(self, file_path): + if not self.__file_exts: + return 0 + file_ext = os.path.splitext( file_path )[1] + if not file_ext: + file_ext = '.' + file_ext + file_ext = '*' + file_ext + if file_ext.lower() in self.__file_exts: + return not self.__is_include_exts + else: + return self.__is_include_exts + + def _subfolders_and_files(self, folder_path): + files, folders = [], [] + folder_contents = os.listdir(folder_path) + for object_name in folder_contents: + object_path = os.path.join(folder_path, object_name) + if os.path.isfile( object_path ) and not self._is_to_skip( object_path ): + files.append( object_path ) + elif os.path.isdir( object_path ): + folders.append( object_path ) + else: + pass + return folders, files + + def __iter__(self): + raise NotImplementedError + + def next(self): + raise NotImplementedError + + def restart(self): + raise NotImplementedError + +class files_iterator_generator(base_files_iterator): + def __init__(self, folders, file_ext_filter = '', is_include_filter = True, is_recursive = True): + base_files_iterator.__init__(self, file_ext_filter, is_include_filter) + self.__folders = _make_list( folders ) + self.__is_recursive = is_recursive + self.__file_generator = None + + def __walk(self): + folders = self.__folders[:] + while folders: + sub_folders, files = self._subfolders_and_files( folders.pop(0) ) + if self.__is_recursive: + for folder in sub_folders: + folders.append( folder ) + for file_os in files: + yield file_os + + def __iter__(self): + self.__file_generator = self.__walk() + return self + + def next(self): + return self.__file_generator.next() + + def restart(self): + self.__file_generator = None + + +class folders_iterator_generator: + def __init__(self, folders, is_recursive = 1): + self.__folders = [] + for root in _make_list( folders ): + self.__folders.extend( self.__sub_folders( root ) ) + self.__is_recursive = is_recursive + self.__folder_generator = None + + def __sub_folders(self, folder_path): + sub_folders = [] + folder_contains = os.listdir(folder_path) + for object_in_folder in folder_contains: + full_path = os.path.join(folder_path, object_in_folder) + if os.path.isdir( full_path ): + sub_folders.append( full_path ) + return sub_folders + + def __walk(self): + folders = self.__folders[:] + for curr_folder in folders: + yield curr_folder + if self.__is_recursive: + for f in folders_iterator_generator( [curr_folder], True ): + yield f + + def __iter__(self): + self.__folder_generator = self.__walk() + return self + + def next(self): + return self.__folder_generator.next() + + def restart(self): + self.__folder_generator = None + +#preserving backward computability names +file_iter = files_iterator_generator +folder_iter = folders_iterator_generator +#new names +files_iterator = files_iterator_generator +folders_iterator = folders_iterator_generator + +if '__main__' == __name__: + #lFileCount = 0 + #for file_os in files_iterator( r'C:\Program Files\Microsoft Visual Studio\VC98\Include\stlport', ['*.h', '*.'], True, False): + #print file_os + #lFileCount += 1 + #print lFileCount + + for folder in folders_iterator( '/home/roman/language-binding', False ): + print folder + for folder in folders_iterator( '/home/roman/language-binding', True ): print folder \ No newline at end of file Modified: pydsc_dev/setup.py =================================================================== --- pydsc_dev/setup.py 2006-08-16 12:44:41 UTC (rev 413) +++ pydsc_dev/setup.py 2006-08-16 18:24:58 UTC (rev 414) @@ -1,16 +1,16 @@ -# 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 -from distutils import sysconfig -from distutils.core import setup - -setup( name="pydsc" - , description="Python documentation and comments spell checker" - , author="Roman Yakovenko" - , author_email="rom...@gm..." - , url='http://pygccxml.sourceforge.net' - , py_modules=[ 'pydsc' ] -) +# 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 +from distutils import sysconfig +from distutils.core import setup + +setup( name="pydsc" + , description="Python documentation and comments spell checker" + , author="Roman Yakovenko" + , author_email="rom...@gm..." + , url='http://pygccxml.sourceforge.net' + , py_modules=[ 'pydsc' ] +) \ No newline at end of file Modified: pydsc_dev/unittests/tester.py =================================================================== --- pydsc_dev/unittests/tester.py 2006-08-16 12:44:41 UTC (rev 413) +++ pydsc_dev/unittests/tester.py 2006-08-16 18:24:58 UTC (rev 414) @@ -1,7 +1,7 @@ -# 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 pydsc -import to_be_tested +# 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 pydsc +import to_be_tested \ No newline at end of file Modified: pydsc_dev/unittests/to_be_tested.py =================================================================== --- pydsc_dev/unittests/to_be_tested.py 2006-08-16 12:44:41 UTC (rev 413) +++ pydsc_dev/unittests/to_be_tested.py 2006-08-16 18:24:58 UTC (rev 414) @@ -1,107 +1,107 @@ -# 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 types - -class code_creator_t(object): - """ +# 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 types + +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' - __INDENTATION = ' ' - LINE_LENGTH = 80 - def __init__(self, parent=None): + Also it provides few convinience functions. + """ + PYPLUSPLUS_NS_NAME = 'pyplusplus' + __INDENTATION = ' ' + LINE_LENGTH = 80 + def __init__(self, parent=None): object.__init__(self) if parent: - assert isinstance( parent, code_creator_t ) - self._parent = parent - self._target_configuration = None - - def _get_parent( self ): - return self._parent + assert isinstance( parent, code_creator_t ) + self._parent = parent + self._target_configuration = None + + def _get_parent( self ): + return self._parent def _set_parent( self, new_parent ): if new_parent: - assert isinstance( new_parent, code_creator_t ) - self._parent = new_parent - """parent - reference to parent code creator""" - parent = property( _get_parent, _set_parent ) - - def _get_target_configuration( self ): - return self._target_configuration - def _set_target_configuration( self, config ): - 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): - parent = self.parent - me = self - while True: - if not parent: - return me - else: - me = parent - parent = me.parent - """top_parent - reference to top parent code creator""" - top_parent = property( _get_top_parent ) - - def _create_impl(self): - """ - function that all derived classes should implement. This function - actually creates code and returns it. Return value of this function is - string. - """ - raise NotImplementedError() - - def create(self): - """ - this function should be used in order to get code that should be - generated. - """ - code = self._create_impl() - assert isinstance( code, types.StringTypes ) - return self.beautify( code ) - - def beautify( self, code ): - """ - function that returns code without leading and trailing whitespaces. - """ - assert isinstance( code, types.StringTypes ) - return code.strip() - - @staticmethod - def indent( code, size=1 ): - """ - function that implements code indent algorithm. - """ - assert isinstance( code, types.StringTypes ) - return code_creator_t.__INDENTATION * size\ - + code.replace( os.linesep - , os.linesep + code_creator_t.__INDENTATION * size ) - - @staticmethod - def unindent( code ): - """ - function that implements code unindent algorithm. - """ - assert isinstance( code, types.StringTypes ) - if code.startswith(code_creator_t.__INDENTATION): - code = code[ len( code_creator_t.__INDENTATION ):] - return code.replace( os.linesep + code_creator_t.__INDENTATION - , os.linesep ) + assert isinstance( new_parent, code_creator_t ) + self._parent = new_parent + """parent - reference to parent code creator""" + parent = property( _get_parent, _set_parent ) + + def _get_target_configuration( self ): + return self._target_configuration + def _set_target_configuration( self, config ): + 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): + parent = self.parent + me = self + while True: + if not parent: + return me + else: + me = parent + parent = me.parent + """top_parent - reference to top parent code creator""" + top_parent = property( _get_top_parent ) - @staticmethod - def is_comment( line ): - """ - function that returns true if content of the line is comment, otherwise - false. + def _create_impl(self): """ - assert isinstance( line, types.StringTypes ) + function that all derived classes should implement. This function + actually creates code and returns it. Return value of this function is + string. + """ + raise NotImplementedError() + + def create(self): + """ + this function should be used in order to get code that should be + generated. + """ + code = self._create_impl() + assert isinstance( code, types.StringTypes ) + return self.beautify( code ) + + def beautify( self, code ): + """ + function that returns code without leading and trailing whitespaces. + """ + assert isinstance( code, types.StringTypes ) + return code.strip() + + @staticmethod + def indent( code, size=1 ): + """ + function that implements code indent algorithm. + """ + assert isinstance( code, types.StringTypes ) + return code_creator_t.__INDENTATION * size\ + + code.replace( os.linesep + , os.linesep + code_creator_t.__INDENTATION * size ) + + @staticmethod + def unindent( code ): + """ + function that implements code unindent algorithm. + """ + assert isinstance( code, types.StringTypes ) + if code.startswith(code_creator_t.__INDENTATION): + code = code[ len( code_creator_t.__INDENTATION ):] + return code.replace( os.linesep + code_creator_t.__INDENTATION + , os.linesep ) + + @staticmethod + def is_comment( line ): + """ + function that returns true if content of the line is comment, otherwise + false. + """ + assert isinstance( line, types.StringTypes ) l = line.lstrip() - #1q2w3e4r-------------- - return l.startswith( '//' ) or l.startswith( '/*' ) + #1q2w3e4r-------------- + return l.startswith( '//' ) or l.startswith( '/*' ) \ No newline at end of file Modified: pygccxml_dev/docs/apidocs/www_configuration.py =================================================================== --- pygccxml_dev/docs/apidocs/www_configuration.py 2006-08-16 12:44:41 UTC (rev 413) +++ pygccxml_dev/docs/apidocs/www_configuration.py 2006-08-16 18:24:58 UTC (rev 414) @@ -1,2 +1,2 @@ -name = 'API docs' +name = 'API docs' main_html_file = 'index.html' \ No newline at end of file Modified: pygccxml_dev/docs/download.rest =================================================================== --- pygccxml_dev/docs/download.rest 2006-08-16 12:44:41 UTC (rev 413) +++ pygccxml_dev/docs/download.rest 2006-08-16 18:24:58 UTC (rev 414) @@ -1,56 +1,56 @@ -================= -pygccxml download -================= - -.. contents:: Table of contents - -------------------------- -pygccxml on SourceForge -------------------------- - -`pygccxml`_ project is hosted on SourceForge. Using SourceForge services you -can: - -1) get access to source code -2) get access to latest release version of `pygccxml`_ +================= +pygccxml download +================= +.. contents:: Table of contents +------------------------- +pygccxml on SourceForge +------------------------- + +`pygccxml`_ project is hosted on SourceForge. Using SourceForge services you +can: + +1) get access to source code +2) get access to latest release version of `pygccxml`_ + + ----------------- Subversion access ----------------- http://sourceforge.net/svn/?group_id=118209 - --------- -Download --------- - -https://sourceforge.net/project/showfiles.php?group_id=118209 - ------------- -Installation ------------- - -In command prompt or shell change current directory to be "pygccxml-X.Y.Z". -"X.Y.Z" is version of `pygccxml`_. Type next command: - -| ``python setup.py install`` - -After this command complete, you should have installed `pygccxml`_ package. - ------------- -Dependencies ------------- - -* `GCC-XML`_ - -.. _`pygccxml` : ./../pygccxml/pygccxml.html -.. _`GCC-XML`: http://www.gccxml.org -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: +-------- +Download +-------- + +https://sourceforge.net/project/showfiles.php?group_id=118209 + +------------ +Installation +------------ + +In command prompt or shell change current directory to be "pygccxml-X.Y.Z". +"X.Y.Z" is version of `pygccxml`_. Type next command: + +| ``python setup.py install`` + +After this command complete, you should have installed `pygccxml`_ package. + +------------ +Dependencies +------------ + +* `GCC-XML`_ + +.. _`pygccxml` : ./../pygccxml/pygccxml.html +.. _`GCC-XML`: http://www.gccxml.org + +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + End: \ No newline at end of file Modified: pygccxml_dev/docs/example/example.py =================================================================== --- pygccxml_dev/docs/example/example.py 2006-08-16 12:44:41 UTC (rev 413) +++ pygccxml_dev/docs/example/example.py 2006-08-16 18:24:58 UTC (rev 414) @@ -1,26 +1,26 @@ -# 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 sys -sys.path.append('../..') #adding pygccxml to the path - -from pygccxml import parser -from pygccxml import declarations - -#configure GCC-XML parser -config = parser.config_t( gccxml_path='/home/roman/gccxml-build/bin/gccxml' ) - -#parsing source file -decls = parser.parse( ['core_class_hierarchy.hpp'], config ) -global_ns = declarations.get_global_namespace( decls ) - -#printing all declarations found in file and its includes -declarations.print_declarations( global_ns ) - -#print all base and derived class names -for class_ in global_ns.classes(): +# 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 sys +sys.path.append('../..') #adding pygccxml to the path + +from pygccxml import parser +from pygccxml import declarations + +#configure GCC-XML parser +config = parser.config_t( gccxml_path='/home/roman/gccxml-build/bin/gccxml' ) + +#parsing source file +decls = parser.parse( ['core_class_hierarchy.hpp'], config ) +global_ns = declarations.get_global_namespace( decls ) + +#printing all declarations found in file and its includes +declarations.print_declarations( global_ns ) + +#print all base and derived class names +for class_ in global_ns.classes(): print class_.name print '\tbases: ', `[base.related_class.name for base in class_.bases]` - print '\tderived: ', `[derive.related_class.name for derive in class_.derived]` + print '\tderived: ', `[derive.related_class.name for derive in class_.derived]` \ No newline at end of file Modified: pygccxml_dev/docs/www_configuration.py =================================================================== --- pygccxml_dev/docs/www_configuration.py 2006-08-16 12:44:41 UTC (rev 413) +++ pygccxml_dev/docs/www_configuration.py 2006-08-16 18:24:58 UTC (rev 414) @@ -1,3 +1,3 @@ -name = 'pygccxml' +name = 'pygccxml' files_to_skip = ['definition.rest'] names = { 'query_interface' : 'query interface' } \ No newline at end of file Modified: pygccxml_dev/pygccxml/__init__.py =================================================================== --- pygccxml_dev/pygccxml/__init__.py 2006-08-16 12:44:41 UTC (rev 413) +++ pygccxml_dev/pygccxml/__init__.py 2006-08-16 18:24:58 UTC (rev 414) @@ -1,38 +1,38 @@ -# 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) - -"""Python GCC-XML front end. - -This package provides functionality to extract and inspect -declarations from C/C++ header files. This is accomplished -by invoking the external tool U{gccxml<http://www.gccxml.org/>} -which parses a header file and dumps the declarations as a -XML file. This XML file is then read by pygccxml and the contents -are made available as appropriate Python objects. - -To parse a set of C/C++ header files you use the -L{parse()<parser.parse>} function in the L{parser} sub package which -returns a tree that contains all declarations found in the header -files. The root of the tree represents the main namespace C{::} and -the children nodes represent the namespace contents such as other -namespaces, classes, functions, etc. Each node in the tree is an -object of a type derived from the -L{declaration_t<declarations.declaration_t>} base class. An inner -node is always either a namespace (L{namespace_t<declarations.namespace_t>}) -or a class (L{class_t<declarations.class_t>}) which are both derived -from L{scopedef_t<declarations.scopedef_t>}. Everything else (free functions, -member functions, enumerations, variables, etc.) is always a leaf. -You will find all those declaration classes in the L{declarations} -sub-package. - -""" - -import pygccxml.declarations as declarations -import pygccxml.parser as parser -import pygccxml.utils as utils - -#TODO: -# 1. Write documentation for filtering functionality. -# 2. Add "explicit" property for constructors +# 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) + +"""Python GCC-XML front end. + +This package provides functionality to extract and inspect +declarations from C/C++ header files. This is accomplished +by invoking the external tool U{gccxml<http://www.gccxml.org/>} +which parses a header file and dumps the declarations as a +XML file. This XML file is then read by pygccxml and the contents +are made available as appropriate Python objects. + +To parse a set of C/C++ header files you use the +L{parse()<parser.parse>} function in the L{parser} sub package which +returns a tree that contains all declarations found in the header +files. The root of the tree represents the main namespace C{::} and +the children nodes represent the namespace contents such as other +namespaces, classes, functions, etc. Each node in the tree is an +object of a type derived from the +L{declaration_t<declarations.declaration_t>} base class. An inner +node is always either a namespace (L{namespace_t<declarations.namespace_t>}) +or a class (L{class_t<declarations.class_t>}) which are both derived +from L{scopedef_t<declarations.scopedef_t>}. Everything else (free functions, +member functions, enumerations, variables, etc.) is always a leaf. +You will find all those declaration classes in the L{declarations} +sub-package. + +""" + +import pygccxml.declarations as declarations +import pygccxml.parser as parser +import pygccxml.utils as utils + +#TODO: +# 1. Write documentation for filtering functionality. +# 2. Add "explicit" property for constructors \ No newline at end of file Modified: pygccxml_dev/pygccxml/declarations/__init__.py =================================================================== --- pygccxml_dev/pygccxml/declarations/__init__.py 2006-08-16 12:44:41 UTC (rev 413) +++ pygccxml_dev/pygccxml/declarations/__init__.py 2006-08-16 18:24:58 UTC (rev 414) @@ -1,163 +1,163 @@ -# 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) - -""" -contains classes that describe different C++ declarations -""" - -from declaration import location_t -from declaration import declaration_t -from scopedef import scopedef_t -from enumeration import enumeration_t -from namespace import namespace_t - -from class_declaration import class_t -from class_declaration import CLASS_TYPES -from class_declaration import ACCESS_TYPES -from class_declaration import hierarchy_info_t -from class_declaration import class_declaration_t - -from typedef import typedef_t - -from cpptypes import type_t -from cpptypes import dummy_type_t -from cpptypes import unknown_t -from cpptypes import fundamental_t -from cpptypes import void_t -from cpptypes import char_t -from cpptypes import unsigned_char_t -from cpptypes import wchar_t -from cpptypes import short_int_t -from cpptypes import short_unsigned_int_t -from cpptypes import bool_t -from cpptypes import int_t -from cpptypes import unsigned_int_t -from cpptypes import long_int_t -from cpptypes import long_unsigned_int_t -from cpptypes import long_long_int_t -from cpptypes import long_long_unsigned_int_t -from cpptypes import float_t -from cpptypes import double_t -from cpptypes import long_double_t -from cpptypes import FUNDAMENTAL_TYPES -from cpptypes import compound_t -from cpptypes import volatile_t -from cpptypes import const_t -from cpptypes import pointer_t -from cpptypes import reference_t -from cpptypes import array_t -from cpptypes import calldef_type_t -from cpptypes import free_function_type_t -from cpptypes import member_function_type_t -from cpptypes import member_variable_type_t -from cpptypes import declarated_t -from cpptypes import type_qualifiers_t -#java types -from cpptypes import java_fundamental_t -from cpptypes import jbyte_t -from cpptypes import jshort_t -from cpptypes import jint_t -from cpptypes import jlong_t -from cpptypes import jfloat_t -from cpptypes import jdouble_t -from cpptypes import jchar_t -from cpptypes import jboolean_t - - - -from variable import variable_t - -from algorithm import full_name -from algorithm import make_flatten -from algorithm import apply_visitor -from algorithm import declaration_path -from algorithm import find_declaration -from algorithm import match_declaration_t -from algorithm import find_all_declarations -from algorithm import find_first_declaration -from algorithm import declaration_files -from algorithm import visit_function_has_not_been_found_t -from algorithm import get_global_namespace - -from calldef import VIRTUALITY_TYPES -from calldef import FUNCTION_VIRTUALITY_TYPES -from calldef import argument_t -from calldef import calldef_t -from calldef import member_calldef_t -from calldef import free_calldef_t -from calldef import operator_t -from calldef import member_function_t -from calldef import constructor_t -from calldef import destructor_t -from calldef import member_operator_t -from calldef import casting_operator_t -from calldef import free_function_t -from calldef import free_operator_t - -from decl_visitor import decl_visitor_t -from type_visitor import type_visitor_t - -from type_traits import decompose_type -from type_traits import decompose_class - - -from type_traits import is_enum -from type_traits import enum_declaration -from type_traits import enum_traits - -from type_traits import is_class -from type_traits import class_traits -from type_traits import is_class_declaration -from type_traits import class_declaration_traits - - -from type_traits import is_same -from type_traits import is_void -from type_traits import is_void_pointer -from type_traits import is_const -from type_traits import base_type -from type_traits import is_array -from type_traits import is_pointer -from type_traits import is_volatile -from type_traits import is_integral -from type_traits import is_reference -from type_traits import is_arithmetic -from type_traits import is_fundamental -from type_traits import is_floating_point -from type_traits import is_base_and_derived -from type_traits import is_convertible -from type_traits import is_noncopyable +# 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) + +""" +contains classes that describe different C++ declarations +""" + +from declaration import location_t +from declaration import declaration_t +from scopedef import scopedef_t +from enumeration import enumeration_t +from namespace import namespace_t + +from class_declaration import class_t +from class_declaration import CLASS_TYPES +from class_declaration import ACCESS_TYPES +from class_declaration import hierarchy_info_t +from class_declaration import class_declaration_t + +from typedef import typedef_t + +from cpptypes import type_t +from cpptypes import dummy_type_t +from cpptypes import unknown_t +from cpptypes import fundamental_t +from cpptypes import void_t +from cpptypes import char_t +from cpptypes import unsigned_char_t +from cpptypes import wchar_t +from cpptypes import short_int_t +from cpptypes import short_unsigned_int_t +from cpptypes import bool_t +from cpptypes import int_t +from cpptypes import unsigned_int_t +from cpptypes import long_int_t +from cpptypes import long_unsigned_int_t +from cpptypes import long_long_int_t +from cpptypes import long_long_unsigned_int_t +from cpptypes import float_t +from cpptypes import double_t +from cpptypes import long_double_t +from cpptypes import FUNDAMENTAL_TYPES +from cpptypes import compound_t +from cpptypes import volatile_t +from cpptypes import const_t +from cpptypes import pointer_t +from cpptypes import reference_t +from cpptypes import array_t +from cpptypes import calldef_type_t +from cpptypes import free_function_type_t +from cpptypes import member_function_type_t +from cpptypes import member_variable_type_t +from cpptypes import declarated_t +from cpptypes import type_qualifiers_t +#java types +from cpptypes import java_fundamental_t +from cpptypes import jbyte_t +from cpptypes import jshort_t +from cpptypes import jint_t +from cpptypes import jlong_t +from cpptypes import jfloat_t +from cpptypes import jdouble_t +from cpptypes import jchar_t +from cpptypes import jboolean_t + + + +from variable import variable_t + +from algorithm import full_name +from algorithm import make_flatten +from algorithm import apply_visitor +from algorithm import declaration_path +from algorithm import find_declaration +from algorithm import match_declaration_t +from algorithm import find_all_declarations +from algorithm import find_first_declaration +from algorithm import declaration_files +from algorithm import visit_function_has_not_been_found_t +from algorithm import get_global_namespace + +from calldef import VIRTUALITY_TYPES +from calldef import FUNCTION_VIRTUALITY_TYPES +from calldef import argument_t +from calldef import calldef_t +from calldef import member_calldef_t +from calldef import free_calldef_t +from calldef import operator_t +from calldef import member_function_t +from calldef import constructor_t +from calldef import destructor_t +from calldef import member_operator_t +from calldef import casting_operator_t +from calldef import free_function_t +from calldef import free_operator_t + +from decl_visitor import decl_visitor_t +from type_visitor import type_visitor_t + +from type_traits import decompose_type +from type_traits import decompose_class + + +from type_traits import is_enum +from type_traits import enum_declaration +from type_traits import enum_traits + +from type_traits import is_class +from type_traits import class_traits +from type_traits import is_class_declaration +from type_traits import class_declaration_traits + + +from type_traits import is_same +from type_traits import is_void +from type_traits import is_void_pointer +from type_traits import is_const +from type_traits import base_type +from type_traits import is_array +from type_traits import is_pointer +from type_traits import is_volatile +from type_traits import is_integral +from type_traits import is_reference +from type_traits import is_arithmetic +from type_traits import is_fundamental +from type_traits import is_floating_point +from type_traits import is_base_and_derived +from type_traits import is_convertible +from type_traits import is_noncopyable from type_traits import is_std_string from type_traits import is_std_wstring - -from type_traits import is_unary_operator -from type_traits import is_binary_operator - -from type_traits import array_size -from type_traits import array_item_type - -from type_traits import remove_cv -from type_traits import remove_const -from type_traits import remove_alias -from type_traits import remove_pointer -from type_traits import remove_volatile -from type_traits import remove_reference -from type_traits import remove_declarated - -from type_traits import has_destructor -from type_traits import has_public_less -from type_traits import has_trivial_copy -from type_traits import has_public_equal -from type_traits import has_public_assign -from type_traits import has_public_destructor -from type_traits import has_public_constructor -from type_traits import has_trivial_constructor -from type_traits import find_trivial_constructor -from type_traits import has_public_binary_operator -from type_traits import has_any_non_copyconstructor +from type_traits import is_unary_operator +from type_traits import is_binary_operator + +from type_traits import array_size +from type_traits import array_item_type + +from type_traits import remove_cv +from type_traits import remove_const +from type_traits import remove_alias +from type_traits import remove_pointer +from type_traits import remove_volatile +from type_traits import remove_reference +from type_traits import remove_declarated + +from type_traits import has_destructor +from type_traits import has_public_less +from type_traits import has_trivial_copy +from type_traits import has_public_equal +from type_traits import has_public_assign +from type_traits import has_public_destructor +from type_traits import has_public_constructor +from type_traits import has_trivial_constructor +from type_traits import find_trivial_constructor +from type_traits import has_public_binary_operator +from type_traits import has_any_non_copyconstructor + from type_traits import smart_pointer_traits from container_traits import list_traits @@ -173,127 +173,126 @@ from container_traits import set_traits from container_traits import hash_set_traits from container_traits import multiset_traits -from container_traits import hash_multiset_traits - -all_container_traits = [ - list_traits - , deque_traits - , queue_traits - , priority_queue - , vector_traits - , stack_traits - , map_traits - , multimap_traits - , hash_map_traits - , hash_multimap_traits - , set_traits - , hash_set_traits - , multiset_traits - , hash_multiset_traits +from container_traits import hash_multiset_traits + +all_container_traits = [ + list_traits + , deque_traits + , queue_traits + , priority_queue + , vector_traits + , stack_traits + , map_traits + , multimap_traits + , hash_map_traits + , hash_multimap_traits + , set_traits + , hash_set_traits + , multiset_traits + , hash_multiset_traits ] - -import templates -import call_invocation - -from filtering import filtering - -from decl_factory import decl_factory_t - -from matchers import matcher_base_t -from matchers import or_matcher_t -from matchers import and_matcher_t -from matchers import not_matcher_t -from matchers import declaration_matcher_t -from matchers import calldef_matcher_t -from matchers import namespace_matcher_t -from matchers import variable_matcher_t -from matchers import regex_matcher_t -from matchers import access_type_matcher_t -from matchers import operator_matcher_t -from matchers import custom_matcher_t -from matchers import virtuality_type_matcher_t + +import templates +import call_invocation + +from filtering import filtering + +from decl_factory import decl_factory_t + +from matchers import matcher_base_t +from matchers import or_matcher_t +from matchers import and_matcher_t +from matchers import not_matcher_t +from matchers import declaration_matcher_t +from matchers import calldef_matcher_t +from matchers import namespace_matcher_t +from matchers import variable_matcher_t +from matchers import regex_matcher_t +from matchers import access_type_matcher_t +from matchers import operator_matcher_t +from matchers import custom_matcher_t +from matchers import virtuality_type_matcher_t from matcher import matcher from mdecl_wrapper import mdecl_wrapper_t from decl_printer import decl_printer_t -from decl_printer import print_declarations - - -#implementation details: I need this trick in order to prevent recursive imports -import scopedef - -scopedef.scopedef_t._impl_all_decl_types = [ - scopedef.scopedef_t - , enumeration_t - , namespace_t - , class_t - , class_declaration_t - , typedef_t - , variable_t - , calldef_t - , member_calldef_t - , free_calldef_t - , operator_t - , member_function_t - , constructor_t - , destructor_t - , member_operator_t - , casting_operator_t - , free_function_t - , free_operator_t -] - -impl_matchers = scopedef.scopedef_t._impl_matchers -impl_decl_types = scopedef.scopedef_t._impl_decl_types - -impl_matchers[ scopedef.scopedef_t.decl ] = declaration_matcher_t - -impl_matchers[ scopedef.scopedef_t.class_ ] = declaration_matcher_t -impl_decl_types[ scopedef.scopedef_t.class_ ] = class_t - -impl_matchers[ scopedef.scopedef_t.variable ] = variable_matcher_t - -impl_matchers[ scopedef.scopedef_t.calldef ] = calldef_matcher_t -impl_decl_types[ scopedef.scopedef_t.calldef ] = calldef_t - -impl_matchers[ scopedef.scopedef_t.operator ] = operator_matcher_t -impl_decl_types[ scopedef.scopedef_t.operator ] = operator_t - -impl_matchers[ scopedef.scopedef_t.member_function ] = calldef_matcher_t -impl_decl_types[ scopedef.scopedef_t.member_function ] = member_function_t - -impl_matchers[ scopedef.scopedef_t.constructor ] = calldef_matcher_t -impl_decl_types[ scopedef.scopedef_t.constructor ] = constructor_t - -impl_matchers[ scopedef.scopedef_t.member_operator ] = operator_matcher_t -impl_decl_types[ scopedef.scopedef_t.member_operator ] = member_operator_t - -impl_matchers[ scopedef.scopedef_t.member_operator ] = operator_matcher_t -impl_decl_types[ scopedef.scopedef_t.member_operator ] = member_operator_t - -impl_matchers[ scopedef.scopedef_t.casting_operator ] = calldef_matcher_t -impl_decl_types[ scopedef.scopedef_t.casting_operator ] = casting_operator_t - -impl_matchers[ scopedef.scopedef_t.enumeration ] = declaration_matcher_t -impl_decl_types[ scopedef.scopedef_t.enumeration ] = enumeration_t - -impl_matchers[ scopedef.scopedef_t.typedef ] = declaration_matcher_t -impl_decl_types[ scopedef.scopedef_t.typedef ] = typedef_t - -impl_matchers[ namespace_t.namespace ] = namesp... [truncated message content] |
From: <rom...@us...> - 2006-08-16 12:44:47
|
Revision: 413 Author: roman_yakovenko Date: 2006-08-16 05:44:41 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=413&view=rev Log Message: ----------- fixing recursive bug Modified Paths: -------------- pydsc_dev/pydsc/pydsc.py Modified: pydsc_dev/pydsc/pydsc.py =================================================================== --- pydsc_dev/pydsc/pydsc.py 2006-08-16 08:48:33 UTC (rev 412) +++ pydsc_dev/pydsc/pydsc.py 2006-08-16 12:44:41 UTC (rev 413) @@ -1,26 +1,26 @@ -# 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) - -""" -Python Documentation Spell Checker. - -The pydsc module contains functionality needed to check documentation strings -and comments for spelling errors, within Python code. The pydsc module depends -on PyEnchant spell checker. PyEnchant provides interface for different spell +# 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) + +""" +Python Documentation Spell Checker. + +The pydsc module contains functionality needed to check documentation strings +and comments for spelling errors, within Python code. The pydsc module depends +on PyEnchant spell checker. PyEnchant provides interface for different spell engines: - * ispell - * aspell - * OpenOffice - -The use of the pydsc module is very simple - just import pydsc and all modules -that will be imported after it will be checked. By default all spelling errors -will be printed to sys.stdout. The pydsc checker could be customized in many -different ways: - * you can define set of files/directories that should be included/excluded - from check process - * you can redefine error messages destination + * ispell + * aspell + * OpenOffice + +The use of the pydsc module is very simple - just import pydsc and all modules +that will be imported after it will be checked. By default all spelling errors +will be printed to sys.stdout. The pydsc checker could be customized in many +different ways: + * you can define set of files/directories that should be included/excluded + from check process + * you can redefine error messages destination * you can redefine and/or re-configurate spell checker Install: @@ -28,228 +28,229 @@ Usage example: -import pydsc +import pydsc import readline #errors will be printed to standart output more complex example ( taken from pygccxml project ): -import pydsc +import pydsc #test only pygccxml -#package_directory defined earlier -pydsc.doc_checker.filter.append( package_directory ) -pydsc.doc_checker.filter_type = pydsc.FILTER_TYPE.INCLUDE -# -map( pydsc.doc_checker.speller.ignore_always - , [ 'org' - , 'http' - , 'bool' - , 'str' - , 'www' - , 'param' - , 'txt' - , 'decl' - , 'decls' - , 'namespace' - , 'enum' - , 'const' - , 'GCC' - , 'xcc' - , 'TODO' - , 'typedef' - , 'os' - , 'normcase' +#package_directory defined earlier +pydsc.doc_checker.filter.append( package_directory ) +pydsc.doc_checker.filter_type = pydsc.FILTER_TYPE.INCLUDE +# +map( pydsc.doc_checker.speller.ignore_always + , [ 'org' + , 'http' + , 'bool' + , 'str' + , 'www' + , 'param' + , 'txt' + , 'decl' + , 'decls' + , 'namespace' + , 'enum' + , 'const' + , 'GCC' + , 'xcc' + , 'TODO' + , 'typedef' + , 'os' + , 'normcase' , 'normpath' ] ) - -""" +""" + __version__ = '0.1' -__author__ = 'Roman Yakovenko <rom...@gm...>' -__url__ = 'http://sourceforge.net/projects/pygccxml/' -__license__ = 'Boost Software License <http://boost.org/more/license_info.html>' - -import os -import sys -import pprint -import inspect -import __builtin__ -from enchant import checker - - -#TODO: source code encoding -# -*- coding: encoding -*- -# -*- coding: iso-8859-15 -*- - -def normalize_path( some_path ): - """return os.path.normcase( os.path.normpath( some_path ) )""" - return os.path.normcase( os.path.normpath( some_path ) ) - -def contains_parent_dir( path, dirs ): - """ - returns true if one of the directories is root directory for the path, - false otherwise - - @param path: path - @type path: str - - @param dirs: list of directories and\\or files - @type dirs: [ str ] - - @return: bool - """ - #precondition: dirs and fpath should be normalize_path'ed before calling this function - return bool( filter( lambda dir: path.startswith( dir ), dirs ) ) - -class FILTER_TYPE: - """defines few filter constants""" - INCLUDE = 'include' - EXCLUDE = 'exclude' - -class checker_t( object ): - """ - applies spell check process on every imported module - - This is the main class of this module. This class applies spell check - process on every imported module. Every documentation string within the - module will be checked. Some comments will be checked too. You should read - inspect module documentation, in order to find out which comments will be - checked. - """ - - def __init__( self - , speller - , writer=None - , filter=None - , filter_type=None - , ignore_identifiers=True ): - """ - initialization method - - During this method, reference to __builtin__.__import__ function is - saved in one of the members of the class, and replaced with import_ - member function. - - @param speller: reference to enchant.checker.SpellChecker object - @type speller: enchant.checker.SpellChecker - - @param writer: reference to instance of class that has write method. - By default sys.stdout will be used. - - @param filter: list of files or directories - @type filter: [ str ] - - @param filter_type: provides interpretation for content of filter parameter - @type filter_type: L{FILTER_TYPE} - - @param ignore_identifiers: often comments/documentation strings contains - class\\method\\function names. Those names, - usually introduce spell error. If ignore_identifiers - set to True, those names will be ignored. - @type ignore_identifiers: bool - """ - object.__init__( self ) - self.__checked = set() - self.__orig_import = __builtin__.__import__ - __builtin__.__import__ = self.import_ - self.__already_imported = set( sys.modules.keys() ) - self.__checked = set() - self.speller = speller - self.writer = writer - if self.writer is None: - self.writer = sys.stdout - self.filter = filter - if self.filter is None: - self.filter = [] - self.filter_type = None - if self.filter_type is None: - self.filter_type = FILTER_TYPE.EXCLUDE - self.ignore_identifiers = ignore_identifiers - - def should_be_checked( self, obj, module=None ): - if id(obj) in self.__checked: - return False - if inspect.isbuiltin( obj ): - return False - if inspect.ismodule( obj ): - if obj.__name__ in self.__already_imported: - return False #do not check already imported modules - try: - source_file = inspect.getsourcefile(obj) - if source_file is None: - source_file = inspect.getfile( obj ) - source_file = normalize_path( source_file ) - if source_file in self.filter \ - or contains_parent_dir( source_file, self.filter ): - return self.filter_type == FILTER_TYPE.INCLUDE - else: - return self.filter_type == FILTER_TYPE.EXCLUDE - except TypeError: - return False #built in module - obj_module = inspect.getmodule( obj ) - if not obj_module is module: - return False - if inspect.isclass( obj ) \ - or inspect.ismethod( obj ) \ - or inspect.isfunction( obj ) \ - or inspect.isroutine( obj ) \ - or inspect.ismethoddescriptor( obj ) \ - or inspect.isdatadescriptor( obj ): - return True - return False - - def import_( self, name, globals=None, locals=None, fromlist=None ): - self.filter = map( normalize_path, self.filter ) - pymodule = self.__orig_import( name, globals, locals, fromlist ) - if self.should_be_checked(pymodule): - #write = self.writer.write - #write( 'inspecting %s%s' % ( inspect.getsourcefile( pymodule ), os.linesep ) ) - self.__already_imported.add( name ) - self.check( pymodule ) - #write( 'inspecting %s done%s' % ( inspect.getsourcefile( pymodule ), os.linesep ) ) - return pymodule - - def __check_text_impl( self, obj, text, text_type ): - if not text: - return - if self.ignore_identifiers \ - and hasattr( obj, '__name__' ) \ - and obj.__name__: - self.speller.ignore_always( obj.__name__ ) - errors = {} - self.speller.set_text( text ) - for error in self.speller: - if not errors.has_key( error.word ): - errors[ error.word ] = [] - errors[ error.word ] = self.speller.suggest() - if not errors: - return - write = self.writer.write - if inspect.getsourcefile( inspect.getmodule( obj ) ): - write( ' error details: %s' % os.linesep ) - write( ' file : %s%s' % ( inspect.getsourcefile( inspect.getmodule( obj ) ), os.linesep ) ) - write( ' line : %d%s' % ( inspect.getsourcelines( obj )[1], os.linesep ) ) - write( ' text type : %s%s' % ( text_type, os.linesep ) ) - else: - write( ' error details: %s' % os.linesep ) - write( ' text type : %s%s' % ( text_type, os.linesep ) ) - for word, suggestions in errors.items(): - write( ' misspelled word: %s%s' % ( word, os.linesep ) ) - write( ' suggestions : %s%s' % ( `suggestions`, os.linesep ) ) - - def check_text( self, obj): - self.__check_text_impl( obj, inspect.getdoc( obj ), 'documentation string' ) - if inspect.getsourcefile( obj ): - self.__check_text_impl( obj, inspect.getcomments( obj ), 'comment' ) - - def check( self, module ): - self.check_text( module ) - to_be_checked = map( lambda x: x[1], inspect.getmembers( module ) ) - while to_be_checked: - member = to_be_checked.pop(0) - if not self.should_be_checked( member, module ): - continue - self.check_text( member ) - to_be_checked.extend( map( lambda x: x[1], inspect.getmembers( member ) ) ) - self.__checked.add( id(member) ) +__author__ = 'Roman Yakovenko <rom...@gm...>' +__url__ = 'http://sourceforge.net/projects/pygccxml/' +__license__ = 'Boost Software License <http://boost.org/more/license_info.html>' -"""documentation spell checker instance""" -doc_checker = checker_t( checker.SpellChecker( "en_US" ) ) \ No newline at end of file +import os +import sys +import pprint +import inspect +import __builtin__ +from enchant import checker + + +#TODO: source code encoding +# -*- coding: encoding -*- +# -*- coding: iso-8859-15 -*- + +def normalize_path( some_path ): + """return os.path.normcase( os.path.normpath( some_path ) )""" + return os.path.normcase( os.path.normpath( some_path ) ) + +def contains_parent_dir( path, dirs ): + """ + returns true if one of the directories is root directory for the path, + false otherwise + + @param path: path + @type path: str + + @param dirs: list of directories and\\or files + @type dirs: [ str ] + + @return: bool + """ + #precondition: dirs and fpath should be normalize_path'ed before calling this function + return bool( filter( lambda dir: path.startswith( dir ), dirs ) ) + +class FILTER_TYPE: + """defines few filter constants""" + INCLUDE = 'include' + EXCLUDE = 'exclude' + +class checker_t( object ): + """ + applies spell check process on every imported module + + This is the main class of this module. This class applies spell check + process on every imported module. Every documentation string within the + module will be checked. Some comments will be checked too. You should read + inspect module documentation, in order to find out which comments will be + checked. + """ + + def __init__( self + , speller + , writer=None + , filter=None + , filter_type=None + , ignore_identifiers=True ): + """ + initialization method + + During this method, reference to __builtin__.__import__ function is + saved in one of the members of the class, and replaced with import_ + member function. + + @param speller: reference to enchant.checker.SpellChecker object + @type speller: enchant.checker.SpellChecker + + @param writer: reference to instance of class that has write method. + By default sys.stdout will be used. + + @param filter: list of files or directories + @type filter: [ str ] + + @param filter_type: provides interpretation for content of filter parameter + @type filter_type: L{FILTER_TYPE} + + @param ignore_identifiers: often comments/documentation strings contains + class\\method\\function names. Those names, + usually introduce spell error. If ignore_identifiers + set to True, those names will be ignored. + @type ignore_identifiers: bool + """ + object.__init__( self ) + self.__checked = set() + self.__orig_import = __builtin__.__import__ + __builtin__.__import__ = self.import_ + self.__already_imported = set( sys.modules.keys() ) + self.__checked = set() + self.speller = speller + self.writer = writer + if self.writer is None: + self.writer = sys.stdout + self.filter = filter + if self.filter is None: + self.filter = [] + self.filter_type = None + if self.filter_type is None: + self.filter_type = FILTER_TYPE.EXCLUDE + self.identifiers = set() + self.ignore_identifiers = ignore_identifiers + + def should_be_checked( self, obj, module=None ): + if id(obj) in self.__checked: + return False + if inspect.isbuiltin( obj ): + return False + if inspect.ismodule( obj ): + if obj.__name__ in self.__already_imported: + return False #do not check already imported modules + try: + source_file = inspect.getsourcefile(obj) + if source_file is None: + source_file = inspect.getfile( obj ) + source_file = normalize_path( source_file ) + if source_file in self.filter \ + or contains_parent_dir( source_file, self.filter ): + return self.filter_type == FILTER_TYPE.INCLUDE + else: + return self.filter_type == FILTER_TYPE.EXCLUDE + except TypeError: + return False #built in module + obj_module = inspect.getmodule( obj ) + if not obj_module is module: + return False + if inspect.isclass( obj ) \ + or inspect.ismethod( obj ) \ + or inspect.isfunction( obj ) \ + or inspect.isroutine( obj ) \ + or inspect.ismethoddescriptor( obj ) \ + or inspect.isdatadescriptor( obj ): + return True + return False + + def import_( self, name, globals=None, locals=None, fromlist=None ): + self.filter = map( normalize_path, self.filter ) + pymodule = self.__orig_import( name, globals, locals, fromlist ) + if self.should_be_checked(pymodule): + #write = self.writer.write + #write( 'inspecting %s%s' % ( inspect.getsourcefile( pymodule ), os.linesep ) ) + self.__already_imported.add( name ) + self.check( pymodule ) + #write( 'inspecting %s done%s' % ( inspect.getsourcefile( pymodule ), os.linesep ) ) + return pymodule + + def __check_text_impl( self, obj, text, text_type ): + if not text: + return + if self.ignore_identifiers and hasattr( obj, '__name__' ) and obj.__name__: + self.identifiers.add( obj.__name__ ) + errors = {} + self.speller.set_text( text ) + for error in self.speller: + if error.word in self.identifiers: + continue + if not errors.has_key( error.word ): + errors[ error.word ] = [] + errors[ error.word ] = self.speller.suggest() + if not errors: + return + write = self.writer.write + if inspect.getsourcefile( inspect.getmodule( obj ) ): + write( ' error details: %s' % os.linesep ) + write( ' file : %s%s' % ( inspect.getsourcefile( inspect.getmodule( obj ) ), os.linesep ) ) + write( ' line : %d%s' % ( inspect.getsourcelines( obj )[1], os.linesep ) ) + write( ' text type : %s%s' % ( text_type, os.linesep ) ) + else: + write( ' error details: %s' % os.linesep ) + write( ' text type : %s%s' % ( text_type, os.linesep ) ) + for word, suggestions in errors.items(): + write( ' misspelled word: %s%s' % ( word, os.linesep ) ) + write( ' suggestions : %s%s' % ( `suggestions`, os.linesep ) ) + + def check_text( self, obj): + self.__check_text_impl( obj, inspect.getdoc( obj ), 'documentation string' ) + if inspect.getsourcefile( obj ): + self.__check_text_impl( obj, inspect.getcomments( obj ), 'comment' ) + + def check( self, module ): + self.check_text( module ) + to_be_checked = map( lambda x: x[1], inspect.getmembers( module ) ) + while to_be_checked: + member = to_be_checked.pop(0) + if not self.should_be_checked( member, module ): + continue + self.check_text( member ) + to_be_checked.extend( map( lambda x: x[1], inspect.getmembers( member ) ) ) + self.__checked.add( id(member) ) + +"""documentation spell checker instance""" +doc_checker = checker_t( checker.SpellChecker( "en_US" ) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-16 08:48:40
|
Revision: 412 Author: roman_yakovenko Date: 2006-08-16 01:48:33 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=412&view=rev Log Message: ----------- reupdating docs - removing white spaces, inserted by MS Word Modified Paths: -------------- pygccxml_dev/docs/history/history.rest Modified: pygccxml_dev/docs/history/history.rest =================================================================== --- pygccxml_dev/docs/history/history.rest 2006-08-16 08:44:16 UTC (rev 411) +++ pygccxml_dev/docs/history/history.rest 2006-08-16 08:48:33 UTC (rev 412) @@ -21,72 +21,93 @@ 0.8.1 ----- -1. `pygccxml`_ has been ported to MacOS X. Many thanks to Darren Garnier! - -2. New type traits have been added: - - * ``enum_traits`` - * ``class_traits`` - * ``class_declaration_traits`` - * ``is_std_string`` - * ``is_std_wstring`` - * ``remove_declarated`` - * ``has_public_less`` - * ``has_public_equal`` - * ``has_public_binary_operator`` - * ``smart_pointer_traits`` - * ``list_traits`` - * ``deque_traits`` - * ``queue_traits`` - * ``priority_queue`` - * ``vector_traits`` - * ``stack_traits`` - * ``map_traits`` - * ``multimap_traits`` - * ``hash_map_traits`` - * ``hash_multimap_traits`` - * ``set_traits`` - * ``hash_set_traits`` - * ``multiset_traits`` - * ``hash_multiset_traits`` - -3. ``enumeration_t`` class interface was changed. Enumeration values are kept - in a list, instead of a dictionary. ``get_name2value_dict`` will build for - you dictionary, where key is an enumeration name, and value is an enumeration - value. - - This has been done in order to provide stable order of enumeration values. - -4. Now you can pass operator symbol, as a name to query functions: - - :: - - cls = global_namespace.class_( 'my_class' ) - op = cls.operator( '<' ) - #instead of - op = cls.operator( symbol='<' ) - -5. `pygccxml`_ improved a lot functionality related to providing feedback to user: - - * every package has its own logger - - * only important user messages are written to ``stdout`` - - * user messages are clear - -6. Support to Java native types has been added. - -7. It is possible to pass an arbitrary string as a parameter to `GCC-XML`_. - -8. Native java types has been added to fundamental types. - -9. Cache classes implementation was improved. - -10. Few bug were fixed. - -11. Documentation was improved. - - +1. `pygccxml`_ has been ported to MacOS X. Many thanks to Darren Garnier! + +2. New type traits have been added: + + * ``enum_traits`` + + * ``class_traits`` + + * ``class_declaration_traits`` + + * ``is_std_string`` + + * ``is_std_wstring`` + + * ``remove_declarated`` + + * ``has_public_less`` + + * ``has_public_equal`` + + * ``has_public_binary_operator`` + + * ``smart_pointer_traits`` + + * ``list_traits`` + + * ``deque_traits`` + + * ``queue_traits`` + + * ``priority_queue`` + + * ``vector_traits`` + + * ``stack_traits`` + + * ``map_traits`` + + * ``multimap_traits`` + + * ``hash_map_traits`` + + * ``hash_multimap_traits`` + + * ``set_traits`` + + * ``hash_set_traits`` + + * ``multiset_traits`` + + * ``hash_multiset_traits`` + +3. ``enumeration_t`` class interface was changed. Enumeration values are kept + in a list, instead of a dictionary. ``get_name2value_dict`` will build for + you dictionary, where key is an enumeration name, and value is an enumeration + value. + + This has been done in order to provide stable order of enumeration values. + +4. Now you can pass operator symbol, as a name to query functions: + :: + + cls = global_namespace.class_( 'my_class' ) + op = cls.operator( '<' ) + #instead of + op = cls.operator( symbol='<' ) + +5. `pygccxml`_ improved a lot functionality related to providing feedback to user: + + * every package has its own logger + + * only important user messages are written to ``stdout`` + + * user messages are clear + +6. Support to Java native types has been added. + +7. It is possible to pass an arbitrary string as a parameter to `GCC-XML`_. + +8. Native java types has been added to fundamental types. + +9. Cache classes implementation was improved. + +10. Few bug were fixed. + +11. Documentation was improved. + ----------- Version 0.8 ----------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-16 08:44:39
|
Revision: 411 Author: roman_yakovenko Date: 2006-08-16 01:44:16 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=411&view=rev Log Message: ----------- updating docs - removing white spaces, inserted by MS Word Modified Paths: -------------- pyplusplus_dev/docs/documentation/how_to.rest pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest pyplusplus_dev/docs/documentation/tutorials/tutorials.rest pyplusplus_dev/docs/examples/examples.rest pyplusplus_dev/docs/history/history.rest pyplusplus_dev/docs/peps/peps_index.rest pyplusplus_dev/docs/pyplusplus.rest pyplusplus_dev/docs/quotes.rest Removed Paths: ------------- pyplusplus_dev/docs/peps/indexing_suite.rest Modified: pyplusplus_dev/docs/documentation/how_to.rest =================================================================== --- pyplusplus_dev/docs/documentation/how_to.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/documentation/how_to.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -110,9 +110,9 @@ That's all. ------------------------------------------------------------- +------------------------------------------------------------- Fatal error C1204:Compiler limit: internal structure overflow ------------------------------------------------------------- +------------------------------------------------------------- If you get this error, that the generated file is too big. You will have to split it to few files. Well, not you but `Py++`_ you will only have to tell that Modified: pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -8,18 +8,20 @@ What is Py++? ------------- -.. include:: ./../../../definition.rest +.. include:: ./../../../definition.rest -------- Preamble -------- I guess you decided to try `Py++`_ API. Good! Lets start. First of all, -please take a look on two files: +please take a look on two files: + * `hello_world.hpp`_ - C++ source code, that we want to export to Python - -* `generate_code.py`_ - Python code, that uses `Py++`_ to export + + +* `generate_code.py`_ - Python code, that uses `Py++`_ to export declarations from the source file .. _`hello_world.hpp` : ./hello_world.html @@ -30,10 +32,10 @@ ---------------- `Py++`_ is built from a few packages, but there is only one package, you -should really to be familiar with - ``module_builder``. This package is some kind -of facade to low level API. It provides simple and intuitive API. The main -class within this package is ``module_builder_t``. The instance of this class will -guide you through the whole process. Next few paragraphs will tell you more about +should really to be familiar with - ``module_builder``. This package is some kind +of facade to low level API. It provides simple and intuitive API. The main +class within this package is ``module_builder_t``. The instance of this class will +guide you through the whole process. Next few paragraphs will tell you more about this class. ------------------------- @@ -46,18 +48,18 @@ 1. ``files`` - list of all C++ source files, that declarations from them, you want to expose. This is the only required parameter. - + 2. ``gccxml_path`` - path to `GCC-XML`_ binary. If you don't supply this argument `pygccxml`_ will look for it using your environment variable ``PATH``. - -There are some other arguments: +There are some other arguments: + * additional include directories * [un]defined symbols ( macros ) * declarations cache * ... -Parsing of source files is done within this method. Post condition of this +Parsing of source files is done within this method. Post condition of this method is - all declarations has been successfully extracted from the sources files. @@ -67,7 +69,7 @@ Not all declarations should be exported! Not every declaration could be exported without human invocation! As you already saw from example, `Py++`_ provides simple and powerful declarations query interface. By default, only declarations -that belongs to files, you have asked to parse, and to files, that lies in the same +that belongs to files, you have asked to parse, and to files, that lies in the same directories as parsed files, will be exported: :: @@ -76,11 +78,11 @@ impl_a.h impl_b.h include/ - a.h //includes impl_a.h + a.h //includes impl_a.h b.h //includes impl_b.h all.h //includes a.h and b.h mb = module_builder( [ 'all.h' ] ) - + All declarations that belongs to ``include`` directory will be signed as included to exporting. All other declarations will be ignored. @@ -94,63 +96,65 @@ * to include/exclude declarations * to set call policies * ... - -I think it is critical for beginners to see what is going on, right? -``module_builder_t`` class has ``print_declarations`` method. You can print whole -declarations tree or some specific declaration. Very convenient, very useful. - + + +I think it is critical for beginners to see what is going on, right? +``module_builder_t`` class has ``print_declarations`` method. You can print whole +declarations tree or some specific declaration. Very convenient, very useful. + ----------------------------------- module_builder_t.build_code_creator ----------------------------------- -Now it is a time to create module code creator. Do you remember, in introduction -to `Py++`_, I told you that before writing code to disc, `Py++`_ will -create some kind of `AST`_. Well this is done by calling -``module_builder_t.build_code_creator`` function. Right now, the only important -argument to the function is ``module_name``. Self explained, is it? - -What is the main value of code creators? Code creators allow you to modify -code before it has been written to disk. For example one common requirement for -open source projects it to have license text within every source file. You can -do it with one line of code only: -:: - - mb.code_creator.license = your license text - -After you call this function, I recommend you not to change declarations -configuration. In most cases the change will take effect, in some cases it will -not! - -This tutorial is not cover code creators and how you should work with them. -I will write another tutorial. - -.. _`AST`: http://en.wikipedia.org/wiki/Abstract_syntax_tree - ------------------------------ -module_builder_t.write_module ------------------------------ -You have almost created your module. The last things left is to write module -code to file(s). You can do it with - -* ``module_builder_t.write_module`` - you should provide file name, the code - will be written in. - -* ``module_builder_t.split_module`` - you should provide directory name. - For big projects it is a must to minimize compilation time. So `Py++`_ - splits your module source code to different files within the directory. - - ------- -Result ------- - -`View generated file`_ - -.. _`View generated file` : ./result.html - - -That's all. I hope you enjoyed. +Now it is a time to create module code creator. Do you remember, in introduction +to `Py++`_, I told you that before writing code to disc, `Py++`_ will create some +kind of `AST`_. Well this is done by calling ``module_builder_t.build_code_creator`` +function. Right now, the only important argument to the function is ``module_name``. +Self explained, is it? + +What is the main value of code creators? Code creators allow you to modify +code before it has been written to disk. For example one common requirement for +open source projects it to have license text within every source file. You can +do it with one line of code only: + +:: + + mb.code_creator.license = your license text + +After you call this function, I recommend you not to change declarations +configuration. In most cases the change will take effect, in some cases it will +not! + +This tutorial is not cover code creators and how you should work with them. +I will write another tutorial. + +.. _`AST`: http://en.wikipedia.org/wiki/Abstract_syntax_tree + +----------------------------- +module_builder_t.write_module +----------------------------- + +You have almost created your module. The last things left is to write module +code to file(s). You can do it with + +* ``module_builder_t.write_module`` - you should provide file name, the code + will be written in. + +* ``module_builder_t.split_module`` - you should provide directory name. + For big projects it is a must to minimize compilation time. So `Py++`_ + splits your module source code to different files within the directory. + +------ +Result +------ + +`View generated file`_ + +.. _`View generated file` : ./result.html + +That's all. I hope you enjoyed. + .. _`Py++` : ./../../../pyplusplus.html .. _`pygccxml` : ./../../../../pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html Modified: pyplusplus_dev/docs/documentation/tutorials/tutorials.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/tutorials.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/documentation/tutorials/tutorials.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -3,51 +3,57 @@ ========= .. contents:: Table of contents - + ------------- What is Py++? ------------- -.. include:: ./../../definition.rest - -------------------- -Graphical interface -------------------- - -`Py++`_ includes a `graphical interface`_. `Graphical interface`_ -is invoked with the ``pyplusplus_gui`` command, or with ``pyplusplus_gui.pyw`` -from the ``scripts`` subdirectory, of the `Python`_ installation directory. - -My advise to you - start with `graphical interface`_, because: - * you don't have to learn new API - * few clicks with mouse and you have `Boost.Python`_ code for your file(s) - * it is very easy to evaluate `Py++`_ using it - * you can check whether `GCC-XML`_ is able to compile your code or not - * you can use it as a guide to `Boost.Python`_ library - * it is able to generate `Py++`_ code for you - -.. _`graphical interface` : ./pyplusplus_demo.png -.. _`Graphical interface` : ./pyplusplus_demo.png - ---------------- -Getting started ---------------- - -I suppose you decided to do some coding with `Py++`_. `Module builder`_ -tutorials will help you. - -.. _`Module builder` : ./module_builder/module_builder.html - --------- -Advanced --------- - -To be written. I think I should cover here the usage of code creators and code -creators tree. Meanwhile you can take a look on the content of -``examples/custom_code_creator`` directory. It contains example, which shows how -to create your own code creator. To be more specific, it exposes ``get*`` and -``set*`` methods as a single property. +.. include:: ./../../definition.rest +------------------- +Graphical interface +------------------- +`Py++`_ includes a `graphical interface`_. `Graphical interface`_ is invoked +with the ``pyplusplus_gui`` command, or with ``pyplusplus_gui.pyw`` from the +``scripts`` subdirectory, of the `Python`_ installation directory. + +My advise to you - start with `graphical interface`_, because: + + * you don't have to learn new API + + * few clicks with mouse and you have `Boost.Python`_ code for your file(s) + + * it is very easy to evaluate `Py++`_ using it + + * you can check whether `GCC-XML`_ is able to compile your code or not + + * you can use it as a guide to `Boost.Python`_ library + + * it is able to generate `Py++`_ code for you + +.. _`graphical interface` : ./pyplusplus_demo.png +.. _`Graphical interface` : ./pyplusplus_demo.png + +--------------- +Getting started +--------------- + +I suppose you decided to do some coding with `Py++`_. `Module builder`_ +tutorials will help you. + +.. _`Module builder` : ./module_builder/module_builder.html + +-------- +Advanced +-------- + +To be written. I think I should cover here the usage of code creators and code +creators tree. Meanwhile you can take a look on the content of +``examples/custom_code_creator`` directory. It contains example, which shows how +to create your own code creator. To be more specific, it exposes ``get*`` and +``set*`` methods as a single property. + + .. _`Py++` : ./../../pyplusplus.html .. _`pygccxml` : ./../....//pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html Modified: pyplusplus_dev/docs/examples/examples.rest =================================================================== --- pyplusplus_dev/docs/examples/examples.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/examples/examples.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -7,8 +7,9 @@ ------------------- Graphical interface ------------------- - -`Py++`_ has nice, small and simple `graphical interface`_. Please, read + + +`Py++`_ has nice, small and simple `graphical interface`_. Please, read `tutorials`_ for more information. .. _`graphical interface` : ./../tutorials/pyplusplus_demo.png @@ -16,34 +17,33 @@ --------- pyeasybmp ---------- - -`EasyBMP`_ is a small cross-platform library that provide you functionality -needed to work with Windows bitmap (BMP) image files. I took me only few minutes -to create Python bindings for the library. Read more `here`__. - -.. __ : ./easybmp/easybmp.html - ---------------- -boost libraries ---------------- - -Boost provides free peer-reviewed portable C++ source libraries. +--------- -Using `Py++`_ I created Python bindings for few libraries: +`EasyBMP`_ is a small cross-platform library that provide you functionality +needed to work with Windows bitmap (BMP) image files. I took me only few minutes +to create Python bindings for the library. Read more `here`__. +.. __ : ./easybmp/easybmp.html + +--------------- +boost libraries +--------------- + +Boost provides free peer-reviewed portable C++ source libraries. Using `Py++`_ I +created Python bindings for few libraries: + * `Boost.Date_Time`_ * `Boost.CRC`_ * `Boost.Rational`_ * `Boost.Random`_ -This is not "just another example". I went father and created new package: +This is not "just another example". I went father and created new package: `pyboost`_. This is fully working Python package, with almost all unit test from -the libraries ported to Python. For more information please read `pyboost`_ +the libraries ported to Python. For more information please read `pyboost`_ package documentation. .. _`pyboost` : ./boost/boost.html - + .. _`boost.date_time` : http://boost.org/doc/html/date_time.html .. _`boost.crc` : http://boost.org/libs/crc/index.html .. _`boost.rational` : http://boost.org/libs/rational/index.html Modified: pyplusplus_dev/docs/history/history.rest =================================================================== --- pyplusplus_dev/docs/history/history.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/history/history.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -4,7 +4,6 @@ .. contents:: Table of contents - ------------ Contributors ------------ @@ -15,48 +14,61 @@ * John Pallister * Matthias Baas * Allen Bierbaum - * Lakin Wecker + * Lakin Wecker + * Georgiy Dernovoy - ------ -0.8.1 ------ - -1. Georgiy Dernovoy contributed a patch, which allows `Py++`_ GUI to - save\\load last used header file. - -2. `Py++`_ improved a lot functionality related to providing feedback to user: - - * every package has its own logger - - * only important user messages are written to ``stdout`` - - * user messages are clear - -3. Support for Boost.Python indexing suite version 2 was implemented. - -4. Every code creator class took ``parent`` argument in ``__init__`` method. - This argument was removed. ``adopt_creator`` and ``remove_creator`` will - set\unset reference to parent. - -5. Generated code for member and free functions was changed. This changed was - introduced to fix compilation errors on msvc 7.1 compiler. - -6. `Py++`_ generates "stable" code. If header files were not changed, - `Py++`_ will not change any file. - -7. Support for huge classes was added. `Py++`_ is able to split registration - code for the class to multiple cpp files. - -8. User code could be added almost anywhere, without use of low level API. - -9. Generated source files include only header files you passes as an argument - to module builder. - -10. Bug fixes. - -11. Documentation was improved.. - + +------------ +Project name +------------ + +In version 0.8.1 project has been renamed from "pyplusplus" to "Py++". +There were few reasons to this: + +1. I like "Py++" more then "pyplusplus". + +2. "Py++" was the original name of the project: http://mail.python.org/pipermail/c++-sig/2005-July/009280.html + +3. Users always changed the name of the projects. I saw at least 6 different names. + + +----- +0.8.1 +----- + +1. Georgiy Dernovoy contributed a patch, which allows `Py++`_ GUI to + save\\load last used header file. + +2. `Py++`_ improved a lot functionality related to providing feedback to user: + + * every package has its own logger + * only important user messages are written to ``stdout`` + * user messages are clear + +3. Support for Boost.Python indexing suite version 2 was implemented. + +4. Every code creator class took ``parent`` argument in ``__init__`` method. + This argument was removed. ``adopt_creator`` and ``remove_creator`` will + set\unset reference to parent. + +5. Generated code for member and free functions was changed. This changed was + introduced to fix compilation errors on msvc 7.1 compiler. + +6. `Py++`_ generates "stable" code. If header files were not changed, + `Py++`_ will not change any file. + +7. Support for huge classes was added. `Py++`_ is able to split registration + code for the class to multiple cpp files. + +8. User code could be added almost anywhere, without use of low level API. + +9. Generated source files include only header files you passes as an argument + to module builder. + +10. Bug fixes. + +11. Documentation was improved.. + ------------- Version 0.8.0 ------------- Deleted: pyplusplus_dev/docs/peps/indexing_suite.rest =================================================================== --- pyplusplus_dev/docs/peps/indexing_suite.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/peps/indexing_suite.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -1,99 +0,0 @@ -====================== -Indexing suite support -====================== - -.. contents:: Table of contents - -------------------- -What is useful for? -------------------- - -http://boost.org/libs/python/doc/v2/indexing.html - -------------- -The way to go -------------- -The generated code should work, even if it contains usage of STD containers -classes. There are few ways to implement indexing suite support within `Py++`_. -I will describe, how I think it should be implemented and used by user. - -Generated code --------------- -All generated code will have next form: -:: - - class_< container, other class parameters >(name) - .def( concrete indexing suite class< container, proxy, derived policies >() ) - ; - -Usage example -------------- -C++ code: -:: - - #include <map> - #include <vector> - -:: - - std::vector<string> get_options(){...} - -:: - - struct my_data{...}; - std::map< int, my_data > get_data(); - -Assumption: user wants to use ``get_options`` and ``get_data`` functions. Next -steps will describe what `Py++`_ will do in this case: - -1. `Py++`_ will analyze functions return type and arguments. - -2. It will understand that ``std::vector< std::string >`` and ``std::map< int, my_data >`` - classes should be exported too. - -3. It will understand that those classes should be exported using indexing suite - functionality provided by `Boost.Python`_ library or `Py++`_ - ``code repository``. - -4. It will generate the code, which will use that functionality. - -So far, so good. Sometimes, there are use cases, when user has to change default -values, for example ``NoProxy`` or ``DerivedPolicies``. What interface `Py++`_ -will provide in order to change the defaults? Well, ``std::vector< std::string >`` -is the class that could be found in declarations tree, right? User can find the -class and change the defaults: -:: - - mb = module_builder_t( ... ) - #the next line will not work, because the real name of std::vector< std::string > - #is platform dependent and much longer. It is there for simplicity. - vector_of_strings = mb.class_( "std::vector< std::string >" ) - vector_of_strings.alias = "StringVector" - vector_of_strings.held_type = ... - vector_of_strings.indexing_suite.no_proxy = False - - -Please, pay attention to the next line: -:: - - vector_of_strings.indexing_suite.no_proxy = False - -Every class, which represents instantiation of some STD container will have -class variable ``indexing_suite``, that will be initialized with relevant -indexing suite class. - - - -.. _`Py++` : ./../pyplusplus.html -.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html -.. _`Python`: http://www.python.org -.. _`GCC-XML`: http://www.gccxml.org - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: - Modified: pyplusplus_dev/docs/peps/peps_index.rest =================================================================== --- pyplusplus_dev/docs/peps/peps_index.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/peps/peps_index.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -6,55 +6,52 @@ ----------- Description ------------ - -This page is an official `Py++`_ "TODO" page. - -For small features, the description of the feature and it's implementation will -be written here. Big features will get their own page. - ---------------- -Unnamed classes ---------------- -There is no technical reason why unnamed classes/structs/unions are not exported -by `Py++`_: -:: - - class Foo{ - union { - struct { - float r,g,b,a; - }; - float val[4]; - }; - }; - -Implementation details ----------------------- -As it seems to me, the only code that should be changed is -"pyplusplus/module_creator/creator.py" file. To be more specific: all code creators, -for declarations in unnamed classes, should be created under named class. - -The coding itself should take something like 4 - 5 hours, including unit test. - ---------------------- -Call wrapper policies ---------------------- - -Not all functions could be exposed to Python as is. This `document`__ will -explain how `Py++`_ will help users to create wrappers around those functions. - -.. __ : ./call_wrapper_policies.html - --------------- -Indexing suite --------------- - -`Py++`_ will expose C++ STD containers. This `document`__ will describe -how it will work. +----------- -.. __ : ./indexing_suite.html +This page is an official `Py++`_ "TODO" page. +For small features, the description of the feature and it's implementation will +be written here. Big features will get their own page. + +--------------- +Unnamed classes +--------------- + +There is no technical reason why unnamed classes/structs/unions are not exported + +by `Py++`_: + +:: + + class Foo{ + union { + struct { + float r,g,b,a; + }; + float val[4]; + }; + }; + + +Implementation details +---------------------- + +As it seems to me, the only code that should be changed is +"pyplusplus/module_creator/creator.py" file. To be more specific: all code creators, +for declarations in unnamed classes, should be created under named class. + +The coding itself should take something like 4 - 5 hours, including unit test. + +--------------------- +Call wrapper policies +--------------------- + +Not all functions could be exposed to Python as is. This `document`__ will +explain how `Py++`_ will help users to create wrappers around those functions. + +.. __ : ./call_wrapper_policies.html + + .. _`Py++` : ./../pyplusplus.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org Modified: pyplusplus_dev/docs/pyplusplus.rest =================================================================== --- pyplusplus_dev/docs/pyplusplus.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/pyplusplus.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -8,69 +8,72 @@ What is Py++? ------------- -.. include:: ./definition.rest +.. include:: ./definition.rest -------- Preamble -------- -This introduction will describe code generation process using Py++. +This introduction will describe code generation process using Py++. I hope, that after you finished to read it, you will understand how powerful -Py++ is. +Py++ is. ----------------------- Code generation process ----------------------- -`Boost.Python`_ library allows you to expose C++ code to `Python`_ in quick and -elegant way. Almost the whole process of exposing declarations can be automated -by use of Py++. Code generation process, using Py++ consists -from few steps. Next paragraphs will tell you more about every step. +`Boost.Python`_ library allows you to expose C++ code to `Python`_ in quick and +elegant way. Almost the whole process of exposing declarations can be automated +by use of Py++. Code generation process, using Py++ consists +from few steps. Next paragraphs will tell you more about every step. + *"read declarations"* ---------------------- +--------------------- -Py++ does not reinvent the wheel. It uses `GCC C++ compiler`_ to parse C++ -source files. To be more precise, the tool chain looks like this: - -1. source code is passed to `GCC-XML`_ -2. `GCC-XML`_ passes it to `GCC C++ compiler`_ -3. `GCC-XML`_ generates an XML description of a C++ program from GCC's internal - representation. -4. Py++ uses `pygccxml`_ package to read `GCC-XML`_ generated file. - -The bottom line - you can be sure, that all your declarations are read correctly. - -.. _`GCC C++ compiler` : http://www.gnu.org/software/gcc +Py++ does not reinvent the wheel. It uses `GCC C++ compiler`_ to parse C++ +source files. To be more precise, the tool chain looks like this: +1. source code is passed to `GCC-XML`_ + +2. `GCC-XML`_ passes it to `GCC C++ compiler`_ + +3. `GCC-XML`_ generates an XML description of a C++ program from GCC's internal + representation. + +4. Py++ uses `pygccxml`_ package to read `GCC-XML`_ generated file. + +The bottom line - you can be sure, that all your declarations are read correctly. + +.. _`GCC C++ compiler` : http://www.gnu.org/software/gcc + + *"build module"* ----------------- -Only very small and simple projects could be exported as is. Most of the projects -still require human invocation. Basically there are 2 questions that you should +Only very small and simple projects could be exported as is. Most of the projects +still require human invocation. Basically there are 2 questions that you should answer: - 1. which declarations should be exported - 2. how this specific declaration should be exported or, if I change a little - a question, what code should be written in order I get access from Python + 1. which declarations should be exported + 2. how this specific declaration should be exported or, if I change a little + a question, what code should be written in order I get access from Python to that functionality -Of course, Py++ cannot answer those question, but it provides maximum -help to implement an user requirements. - -How can Py++ help you with first question? Py++ provides very -powerful and simple query interface. +Of course, Py++ cannot answer those question, but it provides maximum help to +implement an user requirements. -For example in one line of code you can select all free functions that have -two arguments, where the first argument has type ``int &`` and the type of the -second argument is any: +How can Py++ help you with first question? Py++ provides very powerful and +simple query interface. For example in one line of code you can select all free +functions that have two arguments, where the first argument has type ``int &`` +and the type of the second argument is any: :: mb = module_builder_t( ... ) #module_builder_t is the main class that #will help you with code generation process mb.free_functions( arg_types=[ 'int &', None ] ) -An other example - the developer wants to exclude all protected functions from +An other example - the developer wants to exclude all protected functions from being exported: :: @@ -83,109 +86,110 @@ mb = module_builder_t( ... ) mb.decls( lambda decl: 'impl' in decl.name ).exclude() - -Please, note the way queries were built. You can think about those queries as -the rules, which will continue to work even after exported C++ code was changed. -It means that you don't have to change code generator source code every time. -So far, so good what about second question? Well, by default Py++ -generates a code that will satisfy almost all developers. Py++ relevant -classes could be configured in many ways to satisfy your needs. But sometimes -this is still not enough. There are use cases when you need full control over -generated code. One of the biggest problems, with code generators in general, is -modifying generated code and preserving changes. How many code generators did -you use or know, that allow you to put your code anywhere or to reorder generated -code as you wish? Py++ allows you to do that. -Py++ introduces new concept: code creator and code creators tree. You can think -about code creators tree as some kind of `AST`_. The only difference is that code -creators tree provides more specific functionality. For example ``include_t`` code -creator is responsible to create C++ ``include`` directive code. You have full -control over code creators tree, before it is written to disc. Here you +Please, note the way queries were built. You can think about those queries as +the rules, which will continue to work even after exported C++ code was changed. +It means that you don't have to change code generator source code every time. + +So far, so good what about second question? Well, by default Py++ generates a +code that will satisfy almost all developers. Py++ relevant classes could be +configured in many ways to satisfy your needs. But sometimes this is still not +enough. There are use cases when you need full control over generated code. One +of the biggest problems, with code generators in general, is modifying generated +code and preserving changes. How many code generators did you use or know, that +allow you to put your code anywhere or to reorder generated code as you wish? +Py++ allows you to do that. + +Py++ introduces new concept: code creator and code creators tree. You can think +about code creators tree as some kind of `AST`_. The only difference is that code +creators tree provides more specific functionality. For example ``include_t`` code +creator is responsible to create C++ ``include`` directive code. You have full +control over code creators tree, before it is written to disc. Here you can find UML diagram of almost all code creators: `class diagram`_. - + .. _`AST`: http://en.wikipedia.org/wiki/Abstract_syntax_tree .. _`class diagram`: ./code_creators_uml.png -At the end of this step you have code creators tree, which is ready to be written +At the end of this step you have code creators tree, which is ready to be written to disc. -*"write code to files"* +*"write code to files"* ----------------------- -During this step Py++ reads code creators tree and writes code to the -disc. The result of code generation process should not be different from the one, -that would be achieved by human. For small project writing all code into single +During this step Py++ reads code creators tree and writes code to the +disc. The result of code generation process should not be different from the one, +that would be achieved by human. For small project writing all code into single file is good approach, for big ones code should be written into multiple files. -Py++ implements both strategies. +Py++ implements both strategies. ------------- Features list ------------- * classes - + * class wrappers - + * two modes of code generation: - + * using scope - better error messages location from compiler - + * no scope - + * automatic detection of held type - + * nested classes - + * implicit conversion * functions - + * virtual methods - + * protected method, even non-virtual ones can be accessed from `Python`_. - + * overloading - + * two modes of code generation: - - * with function type - good for exporting template instantiated + + * with function type - good for exporting template instantiated functions and overloaded ones. - + * without function type - + * static methods - + * code generated for wrapped methods takes into account types of arguments - + * operators, both free and member ones - + * call policies resolver - - * enumerations + * enumerations + * variables, bit fields * namespace aliasing and using - + * writing multiple files - + * user code could be inserted almost any where * write code into file if there were changes - * user license is written at the top of every file - + * user license is written at the top of every file + * extracting documentation from source files and integrating it with generated source code - + * ... ------- License ------- -`Boost Software License`_. - +`Boost Software License`_. + .. _`Py++` : ./pyplusplus.html .. _`pygccxml` : ./../pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html Modified: pyplusplus_dev/docs/quotes.rest =================================================================== --- pyplusplus_dev/docs/quotes.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/quotes.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -1,78 +1,76 @@ -========================= -What they say about Py++? -========================= +========================= +What they say about Py++? +========================= .. contents:: Table of contents ----------------- What do they say? ----------------- - -"... If you can, use pyplusplus over pyste. I say that for ALL users of -pyste, pyplusplus is now mature enough to be useful as well as being -actively developed. It can also do quite a few tricks pyste cannot. " - - Niall Douglas, the author of `TnFOX`_ library - -"... On a related note, I highly suggest that any users out there that have -tried/used Pyste but have found it to be too lacking in power should -really give pyplusplus a try. It has allowed me to do everything I -ever wanted to do with Pyste and couldn't and then some. It is really -a great tool and I can't thank Roman enough for taking the time to -create it and make it available. " - +"... If you can, use pyplusplus over pyste. I say that for ALL users of +pyste, pyplusplus is now mature enough to be useful as well as being +actively developed. It can also do quite a few tricks pyste cannot. " + + Niall Douglas, the author of `TnFOX`_ library + + +"... On a related note, I highly suggest that any users out there that have +tried/used Pyste but have found it to be too lacking in power should +really give pyplusplus a try. It has allowed me to do everything I +ever wanted to do with Pyste and couldn't and then some. It is really +a great tool and I can't thank Roman enough for taking the time to +create it and make it available. " + Allen Bierbaum, the author of `PyOpenSG`_ library - -"... This rule based approach is amazing for maintenance, as it reduces the -turnaround for binding new code. If the new Ogre API's follow similar rules and -standards as previously defined, the same set of rules will appropriately bind -the new API without any effort on the part of the maintainers. " - -" ... In general, I've really liked working with pyplusplus. I've probably spent -20-30 hours working on these bindings, and they are very close to being equivalent -to the PyOgre bindings (when I last used them). " - - Lakin Wecker, the author of `Python-OGRE`_ project - + +"... This rule based approach is amazing for maintenance, as it reduces the +turnaround for binding new code. If the new Ogre API's follow similar rules and +standards as previously defined, the same set of rules will appropriately bind +the new API without any effort on the part of the maintainers. " + +" ... In general, I've really liked working with pyplusplus. I've probably spent +20-30 hours working on these bindings, and they are very close to being equivalent +to the PyOgre bindings (when I last used them). " + + Lakin Wecker, the author of `Python-OGRE`_ project + ------------------ Who is using Py++? ------------------ -* Matthias Baas, the author of `Python Computer Graphics Kit`_ project, is using - `Py++`_ to create Python bindings for `Maya C++ SDK`__. - +* Matthias Baas, the author of `Python Computer Graphics Kit`_ project, is using + `Py++`_ to create Python bindings for `Maya C++ SDK`__. .. __ : http://www.highend3d.com/maya - -* Lakin Wecker, the author of `Python-OGRE`_ project, is using `Py++`_ to - create Python bindings for `OGRE`_. - +* Lakin Wecker, the author of `Python-OGRE`_ project, is using `Py++`_ to + create Python bindings for `OGRE`_. + * I am :-). I created Python bindings for next libraries: - + * `Boost.Date_Time`_ * `Boost.CRC`_ * `Boost.Rational`_ * `Boost.Random`_ -.. _`boost.date_time` : http://boost.org/doc/html/date_time.html -.. _`boost.crc` : http://boost.org/libs/crc/index.html -.. _`boost.rational` : http://boost.org/libs/rational/index.html -.. _`boost.random` : http://boost.org/libs/random/index.html + .. _`boost.date_time` : http://boost.org/doc/html/date_time.html + .. _`boost.crc` : http://boost.org/libs/crc/index.html + .. _`boost.rational` : http://boost.org/libs/rational/index.html + .. _`boost.random` : http://boost.org/libs/random/index.html You can download the bindings from https://sourceforge.net/project/showfiles.php?group_id=118209 . .. _`Py++` : ./pyplusplus.html -.. _`Python Computer Graphics Kit` : http://cgkit.sourceforge.net/ -.. _`TnFOX`: http://www.nedprod.com/TnFOX/ -.. _`PyOpenSG`: https://realityforge.vrsource.org/view/PyOpenSG/WebHome -.. _`Python-OGRE` : http://lakin.weckers.net/index_ogre_python.html -.. _`OGRE` : http://www.ogre3d.org/index.php?option=com_content&task=view&id=19&Itemid=79 -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: +.. _`Python Computer Graphics Kit` : http://cgkit.sourceforge.net/ +.. _`TnFOX`: http://www.nedprod.com/TnFOX/ +.. _`PyOpenSG`: https://realityforge.vrsource.org/view/PyOpenSG/WebHome +.. _`Python-OGRE` : http://lakin.weckers.net/index_ogre_python.html +.. _`OGRE` : http://www.ogre3d.org/index.php?option=com_content&task=view&id=19&Itemid=79 +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + End: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-16 08:43:30
|
Revision: 410 Author: roman_yakovenko Date: 2006-08-16 01:43:25 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=410&view=rev Log Message: ----------- fixing bug related to indexing suite v2 Modified Paths: -------------- pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py Modified: pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2006-08-16 08:41:53 UTC (rev 409) +++ pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2006-08-16 08:43:25 UTC (rev 410) @@ -18,20 +18,22 @@ self._equality_comparable = None self._less_than_comparable = None self._isuite_version = 1 - + def _get_indexing_suite_version( self ): return self._isuite_version def _set_indexing_suite_version( self, version ): assert version in ( 1, 2 ) - self._isuite_version = version + if self._isuite_version != version: + self._isuite_version = version + self._indexing_suite = None indexing_suite_version = property( _get_indexing_suite_version, _set_indexing_suite_version ) - + def _get_always_expose_using_scope( self ): #I am almost sure this logic should be moved to code_creators if isinstance( self.indexing_suite, isuite2.indexing_suite2_t ) \ and ( self.indexing_suite.disable_methods or self.indexing_suite.disabled_methods_groups ): return True - return self._always_expose_using_scope + return self._always_expose_using_scope def _set_always_expose_using_scope( self, value ): self._always_expose_using_scope = value always_expose_using_scope = property( _get_always_expose_using_scope, _set_always_expose_using_scope ) @@ -47,25 +49,25 @@ break return self._indexing_suite indexing_suite = property( _get_indexing_suite ) - + def _get_equality_comparable( self ): if None is self._equality_comparable: self._equality_comparable = declarations.has_public_equal( self ) return self._equality_comparable - + def _set_equality_comparable( self, value ): self._equality_comparable = value - + equality_comparable = property( _get_equality_comparable, _set_equality_comparable ) def _get_less_than_comparable( self ): if None is self._less_than_comparable: self._less_than_comparable = declarations.has_public_less( self ) return self._less_than_comparable - + def _set_less_than_comparable( self, value ): self._less_than_comparable = value - + less_than_comparable = property( _get_less_than_comparable, _set_less_than_comparable ) @@ -85,12 +87,12 @@ class_common_impl_details_t.__init__( self ) declarations.class_t.__init__(self, *arguments, **keywords ) scopedef_wrapper.scopedef_t.__init__( self ) - - self._redefine_operators = False + + self._redefine_operators = False self._held_type = None self._noncopyable = None self._wrapper_alias = self._generate_valid_name() + "_wrapper" - self._registration_code = [] + self._registration_code = [] self._declaration_code = [] self._wrapper_code = [] self._null_constructor_body = '' @@ -131,31 +133,31 @@ def _finalize_impl( self, error_behavior ): for decl in self.declarations: decl.finalize( error_behavior ) - - @property - def declaration_code( self ): - """ - List of strings, that contains valid C++ code, that will be added to - the class registration section - """ - return self._declaration_code - + @property - def registration_code( self ): - """ - List of strings, that contains valid C++ code, that will be added to - the class registration section + def declaration_code( self ): """ + List of strings, that contains valid C++ code, that will be added to + the class registration section + """ + return self._declaration_code + + @property + def registration_code( self ): + """ + List of strings, that contains valid C++ code, that will be added to + the class registration section + """ return self._registration_code - + @property - def wrapper_code( self ): - """ - List of strings, that contains valid C++ code, that will be added to - the class wrapper. + def wrapper_code( self ): """ + List of strings, that contains valid C++ code, that will be added to + the class wrapper. + """ return self._wrapper_code - + def _get_null_constructor_body(self): return self._null_constructor_body def _set_null_constructor_body(self, body): @@ -167,30 +169,30 @@ def _set_copy_constructor_body(self, body): self._copy_constructor_body = body copy_constructor_body = property( _get_copy_constructor_body, _set_copy_constructor_body ) - - def add_declaration_code( self, code ): - self.declaration_code.append( user_text.user_text_t( code ) ) + def add_declaration_code( self, code ): + self.declaration_code.append( user_text.user_text_t( code ) ) + def add_registration_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.registration_code.append( user_text.class_user_text_t( code, works_on_instance ) ) + self.registration_code.append( user_text.class_user_text_t( code, works_on_instance ) ) #preserving backward computability - add_code = add_registration_code - + add_code = add_registration_code + def add_wrapper_code( self, code ): self.wrapper_code.append( user_text.user_text_t( code ) ) - + def set_constructors_body( self, body ): """Sets the body for all constructors""" self.constructors().body = body self.null_constructor_body = body self.copy_constructor_body = body - + def _exportable_impl( self ): if not self.name: - return 'Py++ can not expose unnamed classes.' + return 'Py++ can not expose unnamed classes.' #it is possible to do so, but not for unnamed classes defined under namespace. if isinstance( self.parent, declarations.namespace_t ): return '' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-16 08:42:02
|
Revision: 409 Author: roman_yakovenko Date: 2006-08-16 01:41:53 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=409&view=rev Log Message: ----------- fixing bug related to indexing suite v2 Modified Paths: -------------- pyplusplus_dev/pyplusplus/module_builder/builder.py Modified: pyplusplus_dev/pyplusplus/module_builder/builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/builder.py 2006-08-16 08:41:16 UTC (rev 408) +++ pyplusplus_dev/pyplusplus/module_builder/builder.py 2006-08-16 08:41:53 UTC (rev 409) @@ -8,13 +8,13 @@ import time from pygccxml import parser -from pygccxml import declarations as decls_package - -from pyplusplus import _logging_ +from pygccxml import declarations as decls_package + +from pyplusplus import _logging_ from pyplusplus import decl_wrappers -from pyplusplus import file_writers +from pyplusplus import file_writers from pyplusplus import code_creators -from pyplusplus import module_creator as mcreator_package +from pyplusplus import module_creator as mcreator_package class module_builder_t(object): """ @@ -22,11 +22,11 @@ and/or pygccxml functionality. If this is your first attempt to use Py++ consider to read tutorials. You can find them on U{web site<http://www.language-binding.net>}. """ - + def __init__( self - , files - , gccxml_path='' - , working_directory='.' + , files + , gccxml_path='' + , working_directory='.' , include_paths=None , define_symbols=None , undefine_symbols=None @@ -40,26 +40,26 @@ """ @param files: list of files, declarations from them you want to export @type files: list of strings or L{file_configuration_t} instances - + @param gccxml_path: path to gccxml binary. If you don't pass this argument, pygccxml parser will try to locate it using you environment PATH variable @type gccxml_path: str - + @param include_paths: additional header files location. You don't have to specify system and standard directories. @type include_paths: list of strings - + @param define_symbols: list of symbols to be defined for preprocessor. @param define_symbols: list of strings - + @param undefine_symbols: list of symbols to be undefined for preprocessor. @param undefine_symbols: list of strings - + @param cflags: Raw string to be added to gccxml command line. """ - object.__init__( self ) + object.__init__( self ) self.logger = _logging_.loggers.module_builder - gccxml_config = parser.config_t( + gccxml_config = parser.config_t( gccxml_path=gccxml_path , working_directory=working_directory , include_paths=include_paths @@ -77,34 +77,34 @@ , parser.project_reader_t.get_os_file_names( files ) ) tmp = map( lambda file_: os.path.split( file_ )[0], self.__parsed_files ) self.__parsed_dirs = filter( None, tmp ) - + self.__global_ns = self.__parse_declarations( files , gccxml_config , compilation_mode , cache - , indexing_suite_version) - self.__code_creator = None + , indexing_suite_version) + self.__code_creator = None if optimize_queries: - self.run_query_optimizer() - - self.__declarations_code_head = [] + self.run_query_optimizer() + + self.__declarations_code_head = [] self.__declarations_code_tail = [] - - self.__registrations_code_head = [] - self.__registrations_code_tail = [] + self.__registrations_code_head = [] + self.__registrations_code_tail = [] + def _get_global_ns( self ): return self.__global_ns global_ns = property( _get_global_ns, doc="reference to global namespace" ) - + def run_query_optimizer(self): """ It is possible to optimze time that takes to execute queries. In most cases this is done from __init__ method. But there are use-case, when you need to disable optimizer at __init__ and run it later. - """ - self.__global_ns.init_optimizer() - + """ + self.__global_ns.init_optimizer() + def __parse_declarations( self, files, gccxml_config, compilation_mode, cache, indexing_suite_version ): if None is gccxml_config: gccxml_config = parser.config_t() @@ -118,21 +118,23 @@ self.logger.debug( 'parsing files - done( %f seconds )' % ( time.clock() - start_time ) ) self.logger.debug( 'settings declarations defaults - started' ) - global_ns = decls_package.matcher.get_single( + global_ns = decls_package.matcher.get_single( decls_package.namespace_matcher_t( name='::' ) , decls ) if indexing_suite_version != 1: for cls in global_ns.classes(): cls.indexing_suite_version = indexing_suite_version - + for cls in global_ns.decls(decl_type=decls_package.class_declaration_t): + cls.indexing_suite_version = indexing_suite_version + start_time = time.clock() self.__apply_decls_defaults(decls) self.logger.debug( 'settings declarations defaults - done( %f seconds )' % ( time.clock() - start_time ) ) return global_ns - + def __filter_by_location( self, flatten_decls ): - for decl in flatten_decls: + for decl in flatten_decls: if not decl.location: continue fpath = decls_package.filtering.normalize_path( decl.location.file_name ) @@ -147,7 +149,7 @@ break if not found: decl.exclude() - + def __apply_decls_defaults(self, decls): flatten_decls = decls_package.make_flatten( decls ) self.__filter_by_location( flatten_decls ) @@ -163,39 +165,39 @@ , mem_vars ) map( lambda mem_var: mem_var.set_setter_call_policies( call_policies_resolver( mem_var, 'set' ) ) , mem_vars ) - - @property - def declarations_code_head( self ): - "List of user code, that will be added to the head of the declarations section." - return self.__declarations_code_head - - @property - def declarations_code_tail( self ): - "List of user code, that will be added to the tail of the declarations section." - return self.__declarations_code_tail - - @property - def registrations_code_head( self ): - "List of user code, that will be added to the head of the registrations section." - return self.__registrations_code_head - - @property - def registrations_code_tail( self ): - "List of user code, that will be added to the tail of the registrations section." - return self.__registrations_code_tail - + + @property + def declarations_code_head( self ): + "List of user code, that will be added to the head of the declarations section." + return self.__declarations_code_head + + @property + def declarations_code_tail( self ): + "List of user code, that will be added to the tail of the declarations section." + return self.__declarations_code_tail + + @property + def registrations_code_head( self ): + "List of user code, that will be added to the head of the registrations section." + return self.__registrations_code_head + + @property + def registrations_code_tail( self ): + "List of user code, that will be added to the tail of the registrations section." + return self.__registrations_code_tail + def print_declarations(self, decl=None, detailed=True, recursive=True, writer=sys.stdout.write): """ This function will print detailed description of all declarations or some specific one. - + @param decl: optional, if passed, then only it will be printed @type decl: instance of L{decl_wrappers.decl_wrapper_t} class - """ - if None is decl: - decl = self.global_ns - decl_wrappers.print_declarations( decl, detailed, recursive, writer ) - + """ + if None is decl: + decl = self.global_ns + decl_wrappers.print_declarations( decl, detailed, recursive, writer ) + def build_code_creator( self , module_name , boost_python_ns_name='bp' @@ -207,20 +209,20 @@ , doc_extractor=None): """ Creates L{module_t} code creator. - - @param module_name: module name + + @param module_name: module name @type module_name: string - - @param boost_python_ns_name: boost::python namespace alias, by default + + @param boost_python_ns_name: boost::python namespace alias, by default it is 'bp' @type boost_python_ns_name: string - + @param call_policies_resolver_: callable, that will be invoked on every calldef object. It should return call policies. @type call_policies_resolver_: callable - @param doc_extractor: callable, that takes as argument reference to declaration + @param doc_extractor: callable, that takes as argument reference to declaration and returns documentation string - @type doc_extractor: callable or None + @type doc_extractor: callable or None """ creator = mcreator_package.creator_t( self.global_ns , module_name @@ -239,74 +241,74 @@ # , self.__parsed_dirs ) return self.__code_creator - + def _get_module( self ): if not self.__code_creator: raise RuntimeError( "self.module is equal to None. Did you forget to call build_code_creator function?" ) return self.__code_creator code_creator = property( _get_module, doc="reference to L{code_creators.module_t} instance" ) - + def has_code_creator( self ): """ - Function, that will return True if build_code_creator function has been + Function, that will return True if build_code_creator function has been called and False otherwise """ return not ( None is self.__code_creator ) - - def add_declaration_code( self, code, tail=True ): - if tail: - self.__declarations_code_tail.append( code ) - else: - self.__declarations_code_head.append( code ) - - def add_registration_code( self, code, tail=True ): - if tail: - self.__registrations_code_tail.append( code ) - else: - self.__registrations_code_head.append( code ) - - def __merge_user_code( self ): - for code in self.__declarations_code_tail: - self.code_creator.add_declaration_code( code, -1 ) - - for code in self.__declarations_code_head: - self.code_creator.add_declaration_code( code, 0 ) - - body = self.code_creator.body - - for code in self.__registrations_code_tail: - body.adopt_creator( code_creators.custom_text_t( code ), -1 ) - - for code in self.__registrations_code_head: - body.adopt_creator( code_creators.custom_text_t( code ), 0 ) - + def add_declaration_code( self, code, tail=True ): + if tail: + self.__declarations_code_tail.append( code ) + else: + self.__declarations_code_head.append( code ) + + def add_registration_code( self, code, tail=True ): + if tail: + self.__registrations_code_tail.append( code ) + else: + self.__registrations_code_head.append( code ) + + def __merge_user_code( self ): + for code in self.__declarations_code_tail: + self.code_creator.add_declaration_code( code, -1 ) + + for code in self.__declarations_code_head: + self.code_creator.add_declaration_code( code, 0 ) + + body = self.code_creator.body + + for code in self.__registrations_code_tail: + body.adopt_creator( code_creators.custom_text_t( code ), -1 ) + + for code in self.__registrations_code_head: + body.adopt_creator( code_creators.custom_text_t( code ), 0 ) + + def write_module( self, file_name ): """ Writes module to single file @param file_name: file name @type file_name: string - """ + """ self.__merge_user_code() file_writers.write_file( self.code_creator, file_name ) - + def split_module(self, dir_name, huge_classes=None): """ Writes module to multiple files - + @param dir_name: directory name - @type dir_name: string - - @param huge_classes: list that contains reference to classes, that should be split - """ - self.__merge_user_code() + @type dir_name: string + + @param huge_classes: list that contains reference to classes, that should be split + """ + self.__merge_user_code() if None is huge_classes: - file_writers.write_multiple_files( self.code_creator, dir_name ) - else: + file_writers.write_multiple_files( self.code_creator, dir_name ) + else: file_writers.write_class_multiple_files( self.code_creator, dir_name, huge_classes ) #select decl(s) interfaces - def decl( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): + def decl( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.decl( name=name , function=function @@ -319,7 +321,7 @@ return self.global_ns.decls( name=name , function=function , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive) def class_( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): @@ -327,7 +329,7 @@ return self.global_ns.class_( name=name , function=function , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive) def classes( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): @@ -335,35 +337,35 @@ return self.global_ns.classes( name=name , function=function , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive) - + def variable( self, name=None, function=None, type=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.variable( name=name - , function=function + , function=function , type=type , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive) def variables( self, name=None, function=None, type=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.variables( name=name - , function=function + , function=function , type=type , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive) - + def calldef( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.calldef( name=name , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive ) def calldefs( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): @@ -371,11 +373,11 @@ return self.global_ns.calldefs( name=name , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir , header_file=header_file , recursive=recursive) - + def operator( self, name=None, symbol=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.operator( name=name @@ -383,9 +385,9 @@ , function=function , decl_type=decl_type , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive ) def operators( self, name=None, symbol=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None, recursive=None ): @@ -395,19 +397,19 @@ , function=function , decl_type=decl_type , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir - , header_file=header_file - , recursive=recursive ) - + , header_file=header_file + , recursive=recursive ) + def member_function( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.member_function( name=name , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive ) def member_functions( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): @@ -415,19 +417,19 @@ return self.global_ns.member_functions( name=name , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir , header_file=header_file , recursive=recursive) - + def constructor( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.constructor( name=name , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive ) def constructors( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): @@ -435,20 +437,20 @@ return self.global_ns.constructors( name=name , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir , header_file=header_file , recursive=recursive) - + def member_operator( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.member_operator( name=name , symbol=symbol , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive ) def member_operators( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): @@ -457,19 +459,19 @@ , symbol=symbol , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir - , header_file=header_file - , recursive=recursive ) - + , header_file=header_file + , recursive=recursive ) + def casting_operator( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.casting_operator( name=name , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive ) def casting_operators( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): @@ -477,30 +479,30 @@ return self.global_ns.casting_operators( name=name , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir , header_file=header_file , recursive=recursive) - def enumeration( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): + def enumeration( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.enumeration( name=name , function=function , header_dir=header_dir , header_file=header_file , recursive=recursive) - enum = enumeration - + enum = enumeration + def enumerations( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.enumerations( name=name , function=function , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive) - - enums = enumerations - + + enums = enumerations + def namespace( self, name=None, function=None, recursive=None ): """Please see L{decl_wrappers.namespace_t} class documentation""" return self.global_ns.namespace( name=name @@ -512,15 +514,15 @@ return self.global_ns.namespaces( name=name , function=function , recursive=recursive ) - + def free_function( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.namespace_t} class documentation""" return self.global_ns.free_function( name=name , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive ) def free_functions( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): @@ -528,7 +530,7 @@ return self.global_ns.free_functions( name=name , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir , header_file=header_file , recursive=recursive) @@ -539,9 +541,9 @@ , symbol=symbol , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive ) def free_operators( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): @@ -550,13 +552,13 @@ , symbol=symbol , function=function , return_type=return_type - , arg_types=arg_types + , arg_types=arg_types , header_dir=header_dir - , header_file=header_file + , header_file=header_file , recursive=recursive ) def _get_BOOST_PYTHON_MAX_ARITY( self ): return decl_wrappers.calldef_t.BOOST_PYTHON_MAX_ARITY def _set_BOOST_PYTHON_MAX_ARITY( self, value ): decl_wrappers.calldef_t.BOOST_PYTHON_MAX_ARITY = value - BOOST_PYTHON_MAX_ARITY = property( _get_BOOST_PYTHON_MAX_ARITY, _set_BOOST_PYTHON_MAX_ARITY ) + BOOST_PYTHON_MAX_ARITY = property( _get_BOOST_PYTHON_MAX_ARITY, _set_BOOST_PYTHON_MAX_ARITY ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-16 08:41:22
|
Revision: 408 Author: roman_yakovenko Date: 2006-08-16 01:41:16 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=408&view=rev Log Message: ----------- fixing small bug - find out value_traits type, should work now for class_declaration_t Modified Paths: -------------- pyplusplus_dev/pyplusplus/file_writers/multiple_files.py Modified: pyplusplus_dev/pyplusplus/file_writers/multiple_files.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/multiple_files.py 2006-08-16 02:20:54 UTC (rev 407) +++ pyplusplus_dev/pyplusplus/file_writers/multiple_files.py 2006-08-16 08:41:16 UTC (rev 408) @@ -88,14 +88,23 @@ return None if not isinstance( code_creator.declaration.indexing_suite, decl_wrappers.indexing_suite2_t ): return None - element_type = code_creator.declaration.indexing_suite.element_type - class_traits = declarations.class_traits - if not class_traits.is_my_case( element_type ): - return None - value_class = class_traits.get_declaration( element_type ) - return self.create_value_traits_header_name( value_class ) - - def create_include_code( self, creators, head_headers=None, tail_headers=None ): + try: + element_type = code_creator.declaration.indexing_suite.element_type + class_traits = declarations.class_traits + if not class_traits.is_my_case( element_type ): + return None + value_class = class_traits.get_declaration( element_type ) + return self.create_value_traits_header_name( value_class ) + except RuntimeError, error: + msg = "%s;%s" \ + % ( str(code_creator.declaration) + , "Py++ can not find out container value_type( mapped_type )." + "The container class is template instantiation declaration and not definition." + "This container class will be exported, but there is a posiblity, that generated code will not compile." + "The solution to the problem is to create a variable of the class." ) + self.logger.warn( msg ) + + def create_include_code( self, creators, head_headers=None, tail_headers=None ): answer = [] normalize = code_creators.include_directories_t.normalize if head_headers: @@ -160,6 +169,7 @@ for creator in declaration_creators: answer.append( '' ) answer.append( creator.create() ) + creator.create = lambda: '' # Write the register() function... answer.append( '' ) @@ -193,11 +203,7 @@ , [class_creator] , decl_creators ) self.write_file( file_path + self.SOURCE_EXT, cpp_code ) - if class_wrapper: - # The wrapper has already been written above, so replace the create() - # method with a new 'method' that just returns an empty string because - # this method is later called again for the main source file. - class_wrapper.create = lambda: '' + # Replace the create() method so that only the register() method is called # (this is called later for the main source file). class_creator.create = lambda: function_name +'();' @@ -298,10 +304,11 @@ def write(self): """ Write out the module. Creates a separate source/header combo for each class and for enums, globals, - and free functions. Post-condition: split_header_names and split_method_names - variables, will contain all the header files and registration methods - used. This can be used by user code to create custom registration - methods if main is not written. + and free functions. + If write_main is True it writes out a main file that calls all the registration methods. + After this call split_header_names and split_method_names will contain + all the header files and registration methods used. This can be used by + user code to create custom registration methods if main is not written. """ self.write_code_repository( self.__directory_path ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-16 02:21:04
|
Revision: 407 Author: roman_yakovenko Date: 2006-08-15 19:20:54 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=407&view=rev Log Message: ----------- Updating documentation Modified Paths: -------------- pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite1.py pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite2.py pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py pyplusplus_dev/pyplusplus/file_writers/multiple_files.py Modified: pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite1.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite1.py 2006-08-15 15:10:44 UTC (rev 406) +++ pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite1.py 2006-08-16 02:20:54 UTC (rev 407) @@ -17,6 +17,11 @@ # 5. shared_ptr class indexing_suite1_t( object ): + """ + This class helps user to export STD containers, using Boost.Python + indexing suite V2. + """ + def __init__( self, container_class, container_traits, no_proxy=None, derived_policies=None ): object.__init__( self ) self.__no_proxy = no_proxy @@ -26,11 +31,13 @@ def _get_container_class( self ): return self.__container_class - container_class = property( _get_container_class ) + container_class = property( _get_container_class + , doc="Reference to STD container class" ) def _get_element_type(self): return self.__container_traits.element_type( self.container_class ) - element_type = property( _get_element_type ) + element_type = property( _get_element_type + , doc="Reference to container value_type( mapped_type ) type" ) def _get_no_proxy( self ): if self.__no_proxy is None: @@ -48,11 +55,17 @@ def _set_no_proxy( self, no_proxy ): self.__no_proxy = no_proxy - no_proxy = property( _get_no_proxy, _set_no_proxy ) + no_proxy = property( _get_no_proxy, _set_no_proxy + , doc="NoProxy value, the initial value depends on container" + +" element_type( mapped_type ) type. In most cases, " + +"Py++ is able to guess this value, right. If you are not " + +"lucky, you will have to set the property value.") def _get_derived_policies( self ): return self.__derived_policies def _set_derived_policies( self, derived_policies ): self.__derived_policies = derived_policies - derived_policies = property( _get_derived_policies, _set_derived_policies ) + derived_policies = property( _get_derived_policies, _set_derived_policies + , doc="This proprty contains DerivedPolicies string. " + +"It will be added as is to the generated code.") \ No newline at end of file Modified: pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite2.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite2.py 2006-08-15 15:10:44 UTC (rev 406) +++ pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite2.py 2006-08-16 02:20:54 UTC (rev 407) @@ -31,10 +31,19 @@ class indexing_suite2_t( object ): + """ + This class helps user to export STD containers, using Boost.Python + indexing suite V2. + """ + + #List of method names. These method could be excluded from being exposed. METHODS = ( 'len', 'iter', 'getitem', 'getitem_slice', 'index', 'contains' , 'count', 'has_key', 'setitem', 'setitem_slice', 'delitem' , 'delitem_slice', 'reverse', 'append', 'insert', 'extend', 'sort' ) + #Dictionary of method group names. These method groups could be excluded from + #being exposed. Dictionary key is a method group name. Dictionary value is a + #list of all methods, which belong to the group. METHOD_GROUPS = { 'slice' : ( 'method_getitem_slice', 'method_setitem_slice', 'method_delitem_slice' ) , 'search' : ( 'method_index', 'method_contains', 'method_count', 'method_has_key' ) @@ -53,22 +62,27 @@ def _get_container_class( self ): return self.__container_class - container_class = property( _get_container_class ) + container_class = property( _get_container_class + , doc="Reference to STD container class" ) def _get_container_traits( self ): return self._get_container_traits() - container_traits = property( _get_container_traits ) + container_traits = property( _get_container_traits + , doc="Reference to container traits. See " + "pygccxml documentation for STD container traits.") def _get_element_type(self): return self.__container_traits.element_type( self.container_class ) - element_type = property( _get_element_type ) + element_type = property( _get_element_type + , doc="Reference to container value_type( mapped_type ) type" ) def _get_call_policies( self ): #TODO find out call policies return self.__call_policies def _set_call_policies( self, call_policies ): self.__call_policies = call_policies - call_policies = property( _get_call_policies, _set_call_policies ) + call_policies = property( _get_call_policies, _set_call_policies + , "Call policies, that should be used by Boost.Python container classes.") def __apply_defaults_if_needed( self ): if self._default_applied: @@ -79,11 +93,13 @@ pass def disable_method( self, method_name ): + """Disable method from being exposed""" assert method_name in self.METHODS self.__apply_defaults_if_needed() self._disabled_methods.add( method_name ) def enable_method( self, method_name ): + """Enable method to be exposed""" assert method_name in self.METHODS self.__apply_defaults_if_needed() if method_name in self._disabled_methods: @@ -92,14 +108,17 @@ def _get_disabled_methods( self ): self.__apply_defaults_if_needed() return self._disabled_methods - disable_methods = property( _get_disabled_methods ) + disable_methods = property( _get_disabled_methods + , doc="list of all disabled methods") def disable_methods_group( self, group_name ): + """Disable methods group from being exposed""" assert group_name in self.METHOD_GROUPS self.__apply_defaults_if_needed() self._disabled_groups.add( group_name ) def enable_methods_group( self, group_name ): + """Enable methods group to be exposed""" assert group_name in self.METHOD_GROUPS self.__apply_defaults_if_needed() if group_name in self._disabled_groups: @@ -108,4 +127,5 @@ def _get_disabled_methods_groups( self ): self.__apply_defaults_if_needed() return self._disabled_groups - disabled_methods_groups = property( _get_disabled_methods_groups ) \ No newline at end of file + disabled_methods_groups = property( _get_disabled_methods_groups + , doc="list of all disabled methods group") \ No newline at end of file Modified: pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py 2006-08-15 15:10:44 UTC (rev 406) +++ pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py 2006-08-16 02:20:54 UTC (rev 407) @@ -7,6 +7,9 @@ import decl_wrapper class variable_t(decl_wrapper.decl_wrapper_t, declarations.variable_t): + + """This class helps user to expose member and global variables.""" + def __init__(self, *arguments, **keywords): declarations.variable_t.__init__(self, *arguments, **keywords ) decl_wrapper.decl_wrapper_t.__init__( self ) @@ -38,8 +41,6 @@ , doc=__call_policies_doc__ ) def _exportable_impl( self ): - #if not isinstance( self.parent, declarations.class_t ): - # return '' if not self.name: return "Py++ can not expose unnamed variables" if self.bits == 0 and self.name == "": Modified: pyplusplus_dev/pyplusplus/file_writers/multiple_files.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/multiple_files.py 2006-08-15 15:10:44 UTC (rev 406) +++ pyplusplus_dev/pyplusplus/file_writers/multiple_files.py 2006-08-16 02:20:54 UTC (rev 407) @@ -25,6 +25,10 @@ @type extmodule: module_t @param directory_path: The output directory where the source files are written @type directory_path: str + + @param write_main: if it is True, the class will write out a main file + that calls all the registration methods. + @type write_main: boolean """ writer.writer_t.__init__(self, extmodule) self.__directory_path = directory_path @@ -294,11 +298,10 @@ def write(self): """ Write out the module. Creates a separate source/header combo for each class and for enums, globals, - and free functions. - If write_main is True it writes out a main file that calls all the registration methods. - After this call split_header_names and split_method_names will contain - all the header files and registration methods used. This can be used by - user code to create custom registration methods if main is not written. + and free functions. Post-condition: split_header_names and split_method_names + variables, will contain all the header files and registration methods + used. This can be used by user code to create custom registration + methods if main is not written. """ self.write_code_repository( self.__directory_path ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mb...@us...> - 2006-08-15 15:10:48
|
Revision: 406 Author: mbaas Date: 2006-08-15 08:10:44 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=406&view=rev Log Message: ----------- Update to reflect the recent modification of multiple_files_t (the write_main parameter was moved from write() to __init__()). Modified Paths: -------------- pyplusplus_dev/contrib/pypp_api/pypp_api/modulebuilder.py Modified: pyplusplus_dev/contrib/pypp_api/pypp_api/modulebuilder.py =================================================================== --- pyplusplus_dev/contrib/pypp_api/pypp_api/modulebuilder.py 2006-08-15 10:41:00 UTC (rev 405) +++ pyplusplus_dev/contrib/pypp_api/pypp_api/modulebuilder.py 2006-08-15 15:10:44 UTC (rev 406) @@ -409,8 +409,8 @@ # Let the arg policy manager write its files... self.mArgPolicyManager.writeFiles(os.path.dirname(filename)) else: - mfs = file_writers.multiple_files_t(extmodule, filename) - mfs.write(write_main=multiCreateMain) + mfs = file_writers.multiple_files_t(extmodule, filename, write_main=multiCreateMain) + mfs.write() self.split_header_names = mfs.split_header_names self.split_method_names = mfs.split_method_names This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-15 10:41:49
|
Revision: 405 Author: roman_yakovenko Date: 2006-08-15 03:41:00 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=405&view=rev Log Message: ----------- fix spelling errors Modified Paths: -------------- index.rest pydsc_dev/docs/pydsc.rest pygccxml_dev/docs/definition.rest pygccxml_dev/docs/design.rest pygccxml_dev/docs/history/history.rest pygccxml_dev/docs/pygccxml.rest pygccxml_dev/docs/query_interface.rest pyplusplus_dev/docs/comparisons/compare_to.rest pyplusplus_dev/docs/comparisons/pyste.rest pyplusplus_dev/docs/documentation/architecture.rest pyplusplus_dev/docs/documentation/best_practices.rest pyplusplus_dev/docs/documentation/containers.rest pyplusplus_dev/docs/documentation/doc_string.rest pyplusplus_dev/docs/documentation/feedback.rest pyplusplus_dev/docs/documentation/how_to.rest pyplusplus_dev/docs/documentation/index.rest pyplusplus_dev/docs/documentation/inserting_code.rest pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest pyplusplus_dev/docs/documentation/tutorials/tutorials.rest pyplusplus_dev/docs/examples/boost/boost.rest pyplusplus_dev/docs/examples/easybmp/easybmp.rest pyplusplus_dev/docs/examples/examples.rest pyplusplus_dev/docs/history/history.rest pyplusplus_dev/docs/links.rest pyplusplus_dev/docs/peps/call_wrapper_policies.rest pyplusplus_dev/docs/peps/indexing_suite.rest pyplusplus_dev/docs/peps/peps_index.rest pyplusplus_dev/docs/pyplusplus.rest Modified: index.rest =================================================================== --- index.rest 2006-08-15 08:44:45 UTC (rev 404) +++ index.rest 2006-08-15 10:41:00 UTC (rev 405) @@ -1,86 +1,89 @@ -=========================== -C++ Python language binding -=========================== - -.. contents:: Table of contents - ----------------- -pygccxml package ----------------- - -* Do you need to parse C++ code? -* Do you need to build code generator? -* Do you need to create UML diagram? - -`pygccxml`_ is the way to go! `Learn more`__. - -.. __: `pygccxml`_ - ------------- -Py++ package ------------- +=========================== +C++ Python language binding +=========================== -"I love deadlines. I love the whooshing noise they make as they go by." +.. contents:: Table of contents - -- Douglas Adams +---------------- +pygccxml package +---------------- -Meet your deadlines with powerful code generator engine - `Py++`_. +* Do you need to parse C++ code? +* Do you need to build code generator? +* Do you need to create UML diagram? -`Py++`_ package and `Boost.Python`_ library provide a complete solution for -interfacing Python and C++. - ---------------- -pyboost package ---------------- - -`Boost`_ provides free peer-reviewed portable C++ source libraries. `pyboost`_ -package export next libraries to Python: - - * `Boost.Date_Time`_ - date time library designed to provide a basis for - performing efficient time calculations - * `Boost.CRC`_ - cyclic redundancy code computation objects - * `Boost.Rational`_ - rational number class - * `Boost.Random`_ - a complete system for random number generation - -Python bindings for `boost.graph`_ library is also available from -http://www.osl.iu.edu/~dgregor/bgl-python . - -------------- -pydsc package -------------- - -Documentation strings contain spelling errors? `Fix them in a minute`_. - -.. _`Fix them in a minute` : `pydsc`_ - ------------------ -pyeasybmp package ------------------ - -`EasyBMP`_ could be easier? Yes of course! Learn more about `EasyBMP Python bindings`_. - -.. _`EasyBMP Python bindings`: ./pyplusplus/examples/easybmp/easybmp.html +`pygccxml`_ is the way to go! `Learn more`__. -.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html - -.. _`pyboost` : ./pyplusplus/examples/boost/boost.html -.. _`boost.graph` : http://www.boost.org/libs/graph/doc/table_of_contents.html -.. _`boost.date_time` : http://boost.org/doc/html/date_time.html -.. _`boost.crc` : http://boost.org/libs/crc/index.html -.. _`boost.rational` : http://boost.org/libs/rational/index.html -.. _`boost.random` : http://boost.org/libs/random/index.html - -.. _`Boost`: http://boost.org/ -.. _`Python`: http://www.python.org -.. _`pygccxml`: ./pygccxml/pygccxml.html -.. _`Py++`: ./pyplusplus/pyplusplus.html -.. _`pydsc`: ./pydsc/pydsc.html -.. _`EasyBMP`: http://easybmp.sourceforge.net/ - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: +.. __: `pygccxml`_ + +------------ +Py++ package +------------ + +"I love deadlines. I love the whooshing noise they make as they go by." + + -- Douglas Adams + +Meet your deadlines with powerful code generator engine - `Py++`_. + +`Py++`_ package and `Boost.Python`_ library provide a complete solution for +interfacing Python and C++. `Learn more`_. + +.. _`Learn more` : `Py++`_ + +--------------- +pyboost package +--------------- + +`Boost`_ provides free peer-reviewed portable C++ source libraries. `pyboost`_ +package export next libraries to Python: + + * `Boost.Date_Time`_ - date time library designed to provide a basis for + performing efficient time calculations + * `Boost.CRC`_ - cyclic redundancy code computation objects + * `Boost.Rational`_ - rational number class + * `Boost.Random`_ - a complete system for random number generation + +Python bindings for `boost.graph`_ library is also available from +http://www.osl.iu.edu/~dgregor/bgl-python . + +------------- +pydsc package +------------- + +Documentation strings contain spelling errors? `Fix them in a minute`_. + +.. _`Fix them in a minute` : `pydsc`_ + +----------------- +pyeasybmp package +----------------- + +`EasyBMP`_ could be easier? Yes of course! Learn more about `EasyBMP Python bindings`_. + +.. _`EasyBMP Python bindings`: ./pyplusplus/examples/easybmp/easybmp.html + +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html + +.. _`pyboost` : ./pyplusplus/examples/boost/boost.html +.. _`boost.graph` : http://www.boost.org/libs/graph/doc/table_of_contents.html +.. _`boost.date_time` : http://boost.org/doc/html/date_time.html +.. _`boost.crc` : http://boost.org/libs/crc/index.html +.. _`boost.rational` : http://boost.org/libs/rational/index.html +.. _`boost.random` : http://boost.org/libs/random/index.html + +.. _`Boost`: http://boost.org/ +.. _`Python`: http://www.python.org +.. _`pygccxml`: ./pygccxml/pygccxml.html +.. _`Py++`: ./pyplusplus/pyplusplus.html +.. _`pydsc`: ./pydsc/pydsc.html +.. _`EasyBMP`: http://easybmp.sourceforge.net/ + +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + End: + Modified: pydsc_dev/docs/pydsc.rest =================================================================== --- pydsc_dev/docs/pydsc.rest 2006-08-15 08:44:45 UTC (rev 404) +++ pydsc_dev/docs/pydsc.rest 2006-08-15 10:41:00 UTC (rev 405) @@ -1,34 +1,33 @@ -================== -pydsc introduction -================== - -.. contents:: Table of contents - -.. meta:: - :description: Python documentation string spell checker +================== +pydsc introduction +================== + +.. contents:: Table of contents + +.. meta:: + :description: Python documentation string spell checker :keywords: Python, docstring, documentation, spell, check - , документация, спеллер, орфографическая коррекция, - --------------- -What is pydsc? --------------- - -.. include:: ./definition.rest - ----------------------- -What it is useful for? ----------------------- - -Well, this project was born to solve real problem - I made a lot of mistakes, -while writing documentation for my projects. I needed some way to check all -Python documentation strings, before I generate documentation from source files. -My goal was simplicity + easy customization. I achieved it. Here is example of -usage of pydsc: - + , документация, спеллер, орфографическая коррекция, + +-------------- +What is pydsc? +-------------- + +.. include:: ./definition.rest + +---------------------- +What it is useful for? +---------------------- + +Well, this project was born to solve real problem - I made a lot of mistakes, +when I write source code documentation for my projects. I needed some way to +check all the documentation strings. My goal was simplicity + easy customization. +I achieved it. Here is example of usage of pydsc: + | ``import pydsc`` -| ``#every module that will be imported after pydsc will be checked`` -| ``#all errors will be printed to stdout`` -| ``import readline`` +| ``#every module that will be imported after pydsc will be checked`` +| ``#all errors will be printed to stdout`` +| ``import readline`` -------------- Spell checking @@ -42,7 +41,7 @@ Usage example ------------- -Basic usage is really simple, but sometimes there is a need to: +Basic usage is really simple, but sometimes there is a need to: * skip\\exclude some words from checking * redefine error messages destination, for example to print to some file * exclude(include) files from(to) spell checking process by file location @@ -62,14 +61,15 @@ http://sourceforge.net/project/showfiles.php?group_id=118209 - -.. _`pydsc`: ./pydsc.html + +.. _`pydsc`: ./pydsc.html .. _`PyEnchant`: http://pyenchant.sourceforge.net/ - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: + +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + End: + Modified: pygccxml_dev/docs/definition.rest =================================================================== --- pygccxml_dev/docs/definition.rest 2006-08-15 08:44:45 UTC (rev 404) +++ pygccxml_dev/docs/definition.rest 2006-08-15 10:41:00 UTC (rev 405) @@ -1,11 +1,11 @@ -"...The purpose of the `GCC-XML`_ extension is to generate an XML description -of a C++ program from GCC's internal representation. Since XML is easy to parse, -other development tools will be able to work with C++ programs without the -burden of a complicated C++ parser..." - --- Introduction to `GCC-XML`_ - -The purpose of `pygccxml`_ is to read a generated file and provide a simple -framework to navigate C++ declarations using Python classes. - -.. _`GCC-XML` : http://www.gccxml.org \ No newline at end of file +"...The purpose of the `GCC-XML`_ extension is to generate an XML description +of a C++ program from GCC's internal representation. Since XML is easy to parse, +other development tools will be able to work with C++ programs without the +burden of a complicated C++ parser..." + +-- Introduction to `GCC-XML`_ + +The purpose of `pygccxml`_ is to read a generated file and provide a simple +framework to navigate C++ declarations, using Python classes. + +.. _`GCC-XML` : http://www.gccxml.org Modified: pygccxml_dev/docs/design.rest =================================================================== --- pygccxml_dev/docs/design.rest 2006-08-15 08:44:45 UTC (rev 404) +++ pygccxml_dev/docs/design.rest 2006-08-15 10:41:00 UTC (rev 405) @@ -1,296 +1,295 @@ -=============== -pygccxml design -=============== - -.. contents:: Table of contents - ------------------------- -The view from 10000 fits ------------------------- - -`pygccxml`_ has 3 packages: - -* ``declarations`` package defines classes that describe C++ declarations and types - -* ``parser`` package defines classes that parse `GCC-XML`_ generared files. Also - it defines few classes that will help you to eliminate unnecessary parsing of - C++ source files. - -* ``utils`` package defines few functions, I found useful in the whole project. - -------------------------- -``declarations`` package -------------------------- - -Please take a look on `UML diagram`_. This `UML diagram`_ describes almost all -classes defined in the package and their relationship. ``declarations`` package -defines two hierarchies of class: - -1. types hierarchy - used to represent a C++ type - -2. declarations hierarchy - used to represent a C++ declaration. - - -Types hierarchy ---------------- - -Types hierarchy is used to represent an arbitrary type in C++. class ``type_t`` -is the base class. - -``type_traits`` -~~~~~~~~~~~~~~~ - -Are you aware of `boost::type_traits`_ library? The `boost::type_traits`_ -library has been developed by John Maddock, Steve Cleary and others. The -`boost::type_traits`_ library contains a set of very specific traits classes, -each of which encapsulate a single trait from the C++ type system; for example, -is a type a pointer or a reference type? Or does a type have a trivial constructor, -or a const-qualifier? - -`pygccxml`_ implements a lot of functionality from the library: - -* a lot of algorithms has been implemented - - + ``is_same`` - - + ``is_enum`` - - + ``is_void`` - - + ``is_const`` - - + ``is_array`` - - + ``is_pointer`` - - + ``is_volatile`` - - + ``is_integral`` - - + ``is_reference`` - - + ``is_arithmetic`` - - + ``is_convertible`` - - + ``is_fundamental`` - - + ``is_floating_point`` - - + ``is_base_and_derived`` - - + ``is_unary_operator`` - - + ``is_binary_operator`` - - + ``remove_cv`` - - + ``remove_const`` - - + ``remove_alias`` - - + ``remove_pointer`` - - + ``remove_volatile`` - - + ``remove_reference`` - - + ``has_trivial_copy`` - - + ``has_trivial_constructor`` - - + ``has_any_non_copyconstructor`` - - For a full list of implemented algorithms, please consult API documentation. - -* a lot of unit tests has been written base on unit tests from the - `boost::type_traits`_ library. - - -If you are going to build code generator, you will find ``type_traits`` very handy. - -Declarations hierarchy ----------------------- - -A declaration hierarchy is used to represent an arbitrary C++ declaration. -Basically, most of the classes defined in this package are just "set of properties". - -``declaration_t`` is the base class of the declaration hierarchy. Every declaration -has ``parent`` property. This property keeps a reference to the scope declaration -instance, in which this declaration is defined. - -The ``scopedef_t`` class derives from ``declaration_t``. This class is used to -say - "I may have other declarations inside". The "composite" design pattern is -used here. ``class_t`` and ``namespace_t`` declaration classes derive from the -``scopedef_t`` class. - ------------------- -``parser`` package ------------------- - -Please take a look on `parser package UML diagram`_ . Classes defined in this -package implement parsing and linking functionality. There are few kind of -classes defined by the package: - -* classes, that implements parsing algorithms of `GCC-XML`_ generated XML file - -* classes, that configure "parser" - -* cache - classes, those one will help you to eliminate unnecessary parsing - -* patchers - classes, that fix `GCC-XML`_ generated declarations. ( Yes, sometimes - GCC-XML generates wrong description of C++ declaration. ) - -Parser classes --------------- - -``source_reader_t`` - the only class that have an detailed knowledge about `GCC-XML`_. -It has only one responsibility: it calls `GCC-XML`_ with a source file specified -by user and creates declarations tree. The implementation of this class is split -to 2 classes: - -1. ``scanner_t`` - this class scans the "XML" file, generated by `GCC-XML`_ and - creates `pygccxml`_ declarations and types classes. After the xml file has - been processed declarations and type class instances keeps references to - each other using `GCC-XML`_ generated id's. - -2. ``linker_t`` - this class contains logic for replacing `GCC-XML`_ generated - ids with references to declarations or type class instances. - -Both those classes are implementation details and should not be used by user. -Performance note: ``scanner_t`` class uses Python ``xml.sax`` package in order -to parse XML. As a result, ``scanner_t`` class is able to parse even big XML files -pretty quick. - -``project_reader_t`` - think about this class as a linker. In most cases you work -with few source files. GCC-XML does not supports this mode of work. So, `pygccxml`_ -implements all functionality needed to parse few source files at once. -``project_reader_t`` implements 2 different algorithms, that solves the problem: - -1. ``project_reader_t`` creates temporal source file, that includes all the source - files. - -2. ``project_reader_t`` parse separately every source file, using ``source_reader_t`` - class and then joins the resulting declarations tree into single declarations - tree. - -Both approaches have different trades-off. The first approach does not allow you -to reuse information from already parsed source files. While the second one -allows you to setup cache. - -Parser configuration classes ----------------------------- - -``config_t`` - a class, that accumulates all the settings needed to invoke `GCC-XML`_: - - -``file_configuration_t`` - a class, that contains some data and description how -to treat the data. ``file_configuration_t`` can contain reference to the next types -of data: - -(1) path to C++ source file - -(2) path to `GCC-XML`_ generated XML file - -(3) path to C++ source file and path to `GCC-XML`_ generated XML file - - In this case, if XML file does not exists, it will be created. Next time - you will ask to parse the source file, the XML file will be used instead. - - Small tip: you can setup your makefile to delete XML files every time, - the relevant source file has changed. - -(4) Python string, that contains valid C++ code - -There are few functions, that will help you to construct ``file_configuration_t`` -object: - -* ``def create_source_fc( header )`` - - ``header`` contains path to C++ source file - -* ``def create_gccxml_fc( xml_file )`` - - ``xml_file`` contains path to `GCC-XML`_ generated XML file - -* ``def create_cached_source_fc( header, cached_source_file )`` - - - ``header`` contains path to C++ source file - - ``xml_file`` contains path to `GCC-XML`_ generated XML file - -* ``def create_text_fc( text )`` - - ``text`` - Python string, that contains valid C++ code - - -Cache classes -------------- - -There are few cache classes, that implements different cache strategies. - -1. ``file_configuration_t`` class, that keeps pass to C++ source file and path to - `GCC-XML`_ generated XML file. This class is not a cache class, but it also - allows you to save your time. - -2. ``file_cache_t`` class, will save all declarations from all files within single - binary file. - -3. ``directory_cache_t`` class will store one index file called "index.dat" which - is always read by the cache when the cache object is created. Each header file - will have its corresponding \*.cache file that stores the declarations found - in the header file. The index file is used to determine whether a \*.cache file - is still valid or not (by checking if one of the dependent files - (i.e. the header file itself and all included files) have been modified since - the last run). - -In some cases, ``directory_cache_t`` class gives much better performance, than -``file_cache_t``. Many thanks to Matthias Baas for its implemention. - -**Warning**: when `pygccxml`_ writes information to files, using cache classes, -it does not write any version information. It means, that when you upgrade -`pygccxml`_ you have to delete all your cache files. Otherwise you will get very -strange errors. For example: missing attribute. - - -Patchers --------- - -Well, `GCC-XML`_ has few bugs, that could not be fixed from it. For example -:: - - namespace ns1{ namespace ns2{ - enum fruit{ apple, orange }; - } } - - void fix_enum( ns1::ns2::fruit arg=ns1::ns2::apple ); - -`GCC-XML`_ will report the default value of ``arg`` as ``apple``. Obviously -this in an error. `pygccxml`_ knows how to fix this bug. - -This is not the only bug, that could be fixed, there are few of them. `pygccxml`_ -introduces few classes, that knows how to deal with specific bug. More over, those -bugs are fixed, only if I am 101% sure, that this is the right thing to do. - -------- -Summary -------- - -Thats all. I hope I was clear, at least I tried. Any way, `pygccxml`_ is an open -source project. You always can take a look on the source code. If you need more -information please read API documentation. - -.. _`pygccxml`: ./pygccxml.html -.. _`SourceForge`: http://sourceforge.net/index.php -.. _`Python`: http://www.python.org -.. _`GCC-XML`: http://www.gccxml.org -.. _`UML diagram` : ./declarations_uml.png -.. _`parser package UML diagram` : ./parser_uml.png -.. _`ReleaseForge` : http://releaseforge.sourceforge.net -.. _`boost::type_traits` : http://www.boost.org/libs/type_traits/index.html -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: \ No newline at end of file +=============== +pygccxml design +=============== + +.. contents:: Table of contents + +------------------------ +The view from 10000 fits +------------------------ + +`pygccxml`_ has 3 packages: + +* ``declarations`` package defines classes that describe C++ declarations and types + +* ``parser`` package defines classes that parse `GCC-XML`_ generated files. Also + it defines few classes that will help you to eliminate unnecessary parsing of + C++ source files. + +* ``utils`` package defines few functions, I found useful in the whole project. + +------------------------- +``declarations`` package +------------------------- + +Please take a look on `UML diagram`_. This `UML diagram`_ describes almost all +classes defined in the package and their relationship. ``declarations`` package +defines two hierarchies of class: + +1. types hierarchy - used to represent a C++ type + +2. declarations hierarchy - used to represent a C++ declaration + + +Types hierarchy +--------------- + +Types hierarchy is used to represent an arbitrary type in C++. class ``type_t`` +is the base class. + +``type_traits`` +~~~~~~~~~~~~~~~ + +Are you aware of `boost::type_traits`_ library? The `boost::type_traits`_ +library contains a set of very specific traits classes, each of which +encapsulate a single trait from the C++ type system; for example, is a type +a pointer or a reference? Or does a type have a trivial constructor, or a +const-qualifier? + +`pygccxml`_ implements a lot of functionality from the library: + +* a lot of algorithms were implemented + + + ``is_same`` + + + ``is_enum`` + + + ``is_void`` + + + ``is_const`` + + + ``is_array`` + + + ``is_pointer`` + + + ``is_volatile`` + + + ``is_integral`` + + + ``is_reference`` + + + ``is_arithmetic`` + + + ``is_convertible`` + + + ``is_fundamental`` + + + ``is_floating_point`` + + + ``is_base_and_derived`` + + + ``is_unary_operator`` + + + ``is_binary_operator`` + + + ``remove_cv`` + + + ``remove_const`` + + + ``remove_alias`` + + + ``remove_pointer`` + + + ``remove_volatile`` + + + ``remove_reference`` + + + ``has_trivial_copy`` + + + ``has_trivial_constructor`` + + + ``has_any_non_copyconstructor`` + + For a full list of implemented algorithms, please consult API documentation. + +* a lot of unit tests has been written base on unit tests from the + `boost::type_traits`_ library. + + +If you are going to build code generator, you will find ``type_traits`` very handy. + +Declarations hierarchy +---------------------- + +A declaration hierarchy is used to represent an arbitrary C++ declaration. +Basically, most of the classes defined in this package are just "set of properties". + +``declaration_t`` is the base class of the declaration hierarchy. Every declaration +has ``parent`` property. This property keeps a reference to the scope declaration +instance, in which this declaration is defined. + +The ``scopedef_t`` class derives from ``declaration_t``. This class is used to +say - "I may have other declarations inside". The "composite" design pattern is +used here. ``class_t`` and ``namespace_t`` declaration classes derive from the +``scopedef_t`` class. + +------------------ +``parser`` package +------------------ + +Please take a look on `parser package UML diagram`_ . Classes defined in this +package, implement parsing and linking functionality. There are few kind of +classes defined by the package: + +* classes, that implements parsing algorithms of `GCC-XML`_ generated XML file + +* parser configuration classes + +* cache - classes, those one will help you to eliminate unnecessary parsing + +* patchers - classes, that fix `GCC-XML`_ generated declarations. ( Yes, sometimes + GCC-XML generates wrong description of C++ declaration. ) + +Parser classes +-------------- + +``source_reader_t`` - the only class that have a detailed knowledge about `GCC-XML`_. +It has only one responsibility: it calls `GCC-XML`_ with a source file specified +by user and creates declarations tree. The implementation of this class is split +to 2 classes: + +1. ``scanner_t`` - this class scans the "XML" file, generated by `GCC-XML`_ and + creates `pygccxml`_ declarations and types classes. After the xml file has + been processed declarations and type class instances keeps references to + each other using `GCC-XML`_ generated ids. + +2. ``linker_t`` - this class contains logic for replacing `GCC-XML`_ generated + ids with references to declarations or type class instances. + +Both those classes are implementation details and should not be used by user. +Performance note: ``scanner_t`` class uses Python ``xml.sax`` package in order +to parse XML. As a result, ``scanner_t`` class is able to parse even big XML files +pretty quick. + +``project_reader_t`` - think about this class as a linker. In most cases you work +with few source files. GCC-XML does not supports this mode of work. So, `pygccxml`_ +implements all functionality needed to parse few source files at once. +``project_reader_t`` implements 2 different algorithms, that solves the problem: + +1. ``project_reader_t`` creates temporal source file, which includes all the source + files. + +2. ``project_reader_t`` parse separately every source file, using ``source_reader_t`` + class and then joins the resulting declarations tree into single declarations + tree. + +Both approaches have different trades-off. The first approach does not allow you +to reuse information from already parsed source files. While the second one +allows you to setup cache. + +Parser configuration classes +---------------------------- + +``config_t`` - a class, that accumulates all the settings needed to invoke `GCC-XML`_: + + +``file_configuration_t`` - a class, that contains some data and description how +to treat the data. ``file_configuration_t`` can contain reference to the next types +of data: + +(1) path to C++ source file + +(2) path to `GCC-XML`_ generated XML file + +(3) path to C++ source file and path to `GCC-XML`_ generated XML file + + In this case, if XML file does not exists, it will be created. Next time + you will ask to parse the source file, the XML file will be used instead. + + Small tip: you can setup your makefile to delete XML files every time, + the relevant source file has changed. + +(4) Python string, that contains valid C++ code + +There are few functions that will help you to construct ``file_configuration_t`` +object: + +* ``def create_source_fc( header )`` + + ``header`` contains path to C++ source file + +* ``def create_gccxml_fc( xml_file )`` + + ``xml_file`` contains path to `GCC-XML`_ generated XML file + +* ``def create_cached_source_fc( header, cached_source_file )`` + + - ``header`` contains path to C++ source file + - ``xml_file`` contains path to `GCC-XML`_ generated XML file + +* ``def create_text_fc( text )`` + + ``text`` - Python string, that contains valid C++ code + + +Cache classes +------------- + +There are few cache classes, which implements different cache strategies. + +1. ``file_configuration_t`` class, that keeps pass to C++ source file and path to + `GCC-XML`_ generated XML file. This class is not a cache class, but it also + allows you to save your time. + +2. ``file_cache_t`` class, will save all declarations from all files within single + binary file. + +3. ``directory_cache_t`` class will store one index file called "index.dat" which + is always read by the cache when the cache object is created. Each header file + will have its corresponding \*.cache file that stores the declarations found + in the header file. The index file is used to determine whether a \*.cache file + is still valid or not (by checking if one of the dependent files + (i.e. the header file itself and all included files) have been modified since + the last run). + +In some cases, ``directory_cache_t`` class gives much better performance, than +``file_cache_t``. Many thanks to Matthias Baas for its implementation. + +**Warning**: when `pygccxml`_ writes information to files, using cache classes, +it does not write any version information. It means, that when you upgrade +`pygccxml`_ you have to delete all your cache files. Otherwise you will get very +strange errors. For example: missing attribute. + + +Patchers +-------- + +Well, `GCC-XML`_ has few bugs, which could not be fixed from it. For example +:: + + namespace ns1{ namespace ns2{ + enum fruit{ apple, orange }; + } } + + void fix_enum( ns1::ns2::fruit arg=ns1::ns2::apple ); + +`GCC-XML`_ will report the default value of ``arg`` as ``apple``. Obviously +this in an error. `pygccxml`_ knows how to fix this bug. + +This is not the only bug, which could be fixed, there are few of them. `pygccxml`_ +introduces few classes, which knows how to deal with specific bug. More over, those +bugs are fixed, only if I am 101% sure, that this is the right thing to do. + +------- +Summary +------- + +Thats all. I hope I was clear, at least I tried. Any way, `pygccxml`_ is an open +source project. You always can take a look on the source code. If you need more +information please read API documentation. + +.. _`pygccxml`: ./pygccxml.html +.. _`SourceForge`: http://sourceforge.net/index.php +.. _`Python`: http://www.python.org +.. _`GCC-XML`: http://www.gccxml.org +.. _`UML diagram` : ./declarations_uml.png +.. _`parser package UML diagram` : ./parser_uml.png +.. _`ReleaseForge` : http://releaseforge.sourceforge.net +.. _`boost::type_traits` : http://www.boost.org/libs/type_traits/index.html +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + End: Modified: pygccxml_dev/docs/history/history.rest =================================================================== --- pygccxml_dev/docs/history/history.rest 2006-08-15 08:44:45 UTC (rev 404) +++ pygccxml_dev/docs/history/history.rest 2006-08-15 10:41:00 UTC (rev 405) @@ -1,289 +1,289 @@ -============================ -pygccxml development history -============================ - -.. contents:: Table of contents - ------------- -Contributors ------------- - -Thanks to all the people that have contributed patches, bug reports and suggestions: - - * My wife - Yulia - * John Pallister - * Matthias Baas - * Allen Bierbaum - * Georgiy Dernovoy - * Darren Garnier - ------ -0.8.1 ------ - -1. `pygccxml`_ has been ported to MacOS X. Many thanks to Darren Garnier! +============================ +pygccxml development history +============================ -2. New type traits have been added: - - * ``enum_traits`` - * ``class_traits`` - * ``class_declaration_traits`` - * ``is_std_string`` - * ``is_std_wstring`` - * ``remove_declarated`` - * ``has_public_less`` - * ``has_public_equal`` - * ``has_public_binary_operator`` - * ``smart_pointer_traits`` - * ``list_traits`` - * ``deque_traits`` - * ``queue_traits`` - * ``priority_queue`` - * ``vector_traits`` - * ``stack_traits`` - * ``map_traits`` - * ``multimap_traits`` - * ``hash_map_traits`` - * ``hash_multimap_traits`` - * ``set_traits`` - * ``hash_set_traits`` - * ``multiset_traits`` - * ``hash_multiset_traits`` - -3. ``enumeration_t`` class interface was changed. Enumeration values are kept - in a list, instead of a dictionary. ``get_name2value_dict`` will build for - you dictionary, where key is an enumeration name, and value is an enumeration - value. - - This has been done in order to provide stable order of enumeration values. - -4. Now you can pass operator symbol, as a name to query functions: +.. contents:: Table of contents - :: +------------ +Contributors +------------ - cls = global_namespace.class_( 'my_class' ) - op = cls.operator( '<' ) - #instead of - op = cls.operator( symbol='<' ) +Thanks to all the people that have contributed patches, bug reports and suggestions: -5. `pygccxml`_ improved a lot functionality related to providing feedback to user: - - * every package has its own logger - - * only important user messages are written to ``stdout`` - - * user messages are clear + * My wife - Yulia + * John Pallister + * Matthias Baas + * Allen Bierbaum + * Georgiy Dernovoy + * Darren Garnier -6. Support to Java native types has been added. +----- +0.8.1 +----- -7. It is possible to pass an arbitrary string as a parameter to `GCC-XML`_. +1. `pygccxml`_ has been ported to MacOS X. Many thanks to Darren Garnier! + +2. New type traits have been added: + + * ``enum_traits`` + * ``class_traits`` + * ``class_declaration_traits`` + * ``is_std_string`` + * ``is_std_wstring`` + * ``remove_declarated`` + * ``has_public_less`` + * ``has_public_equal`` + * ``has_public_binary_operator`` + * ``smart_pointer_traits`` + * ``list_traits`` + * ``deque_traits`` + * ``queue_traits`` + * ``priority_queue`` + * ``vector_traits`` + * ``stack_traits`` + * ``map_traits`` + * ``multimap_traits`` + * ``hash_map_traits`` + * ``hash_multimap_traits`` + * ``set_traits`` + * ``hash_set_traits`` + * ``multiset_traits`` + * ``hash_multiset_traits`` + +3. ``enumeration_t`` class interface was changed. Enumeration values are kept + in a list, instead of a dictionary. ``get_name2value_dict`` will build for + you dictionary, where key is an enumeration name, and value is an enumeration + value. + + This has been done in order to provide stable order of enumeration values. + +4. Now you can pass operator symbol, as a name to query functions: + + :: + + cls = global_namespace.class_( 'my_class' ) + op = cls.operator( '<' ) + #instead of + op = cls.operator( symbol='<' ) + +5. `pygccxml`_ improved a lot functionality related to providing feedback to user: + + * every package has its own logger + + * only important user messages are written to ``stdout`` + + * user messages are clear + +6. Support to Java native types has been added. + +7. It is possible to pass an arbitrary string as a parameter to `GCC-XML`_. + +8. Native java types has been added to fundamental types. + +9. Cache classes implementation was improved. + +10. Few bug were fixed. + +11. Documentation was improved. + + +----------- +Version 0.8 +----------- -8. Native java types has been added to fundamental types. +1. `pygccxml`_ now has power "select" interface. Read more about this cool feature + in tutorials. -9. Cache classes implementation was improved. +2. Improved support for template instantiations. `pygccxml`_ now take into + account demangled name of declarations. Please refer to documentation for + more explanantion. -10. Few bug were fixed. +3. ``dummy_type_t`` - new type in types hierarchy. This is a very useful class + for code generation projects. -11. Documentation was improved. +4. New function - ``get_global_namespace``. As you can guess, it will find and + return reference to global namespace. +5. New functionality in ``type_traits`` - ``has_public_assign``. This function + will return True, if class has public assign operator. ------------ -Version 0.8 ------------ - -1. `pygccxml`_ now has power "select" interface. Read more about this cool feature - in tutorials. - -2. Improved support for template instantiations. `pygccxml`_ now take into - account demangled name of declarations. Please refer to documentation for - more explanantion. - -3. ``dummy_type_t`` - new type in types hierarchy. This is a very useful class - for code generation projects. - -4. New function - ``get_global_namespace``. As you can guess, it will find and - return reference to global namespace. - -5. New functionality in ``type_traits`` - ``has_public_assign``. This function - will return True, if class has public assign operator. - -6. ``declarations.class_t`` has new property - ``aliases``. This is a list of - all class aliases. - -7. Bug fixes. - -8. Documentation has been updated/written/improved. - -------------- -Version 0.7.1 -------------- - -**Attention - this going to be last version that is tested with Python 2.3** - -1. New fundamental types has been added - - * complex float - - * complex double - - * complex long double - -2. **Attention - non backward compatible change** - - ``declarations.filtering.user_defined`` and ``declarations.filtering.by_location`` - implementation has been changed. In previous version of those functions, - ``decls`` list has been changed in place. This was wrong behaviour. Now, - those functions will return new list, that contains all desired declarations. - -3. Few new type traits has been added - - * *type_traits.has_destructor* - - * *type_traits.has_public_destructor* - - * *type_traits.has_public_constructor* - - * *type_traits.is_noncopyable* - -4. ``decl_printer_t`` class and ``print_declarations`` function have been added. - Now you can print in a nice way your declaration tree or part of it. - Thanks to Allen Bierbaum! - -5. New class ``declarations.decl_factory_t`` has been added. This is a default - factory for all declarations. From now all relevant parser classes takes as - input instance of this class or ``Null``. In case of ``Null`` instance of - ``declarations.decl_factory_t`` will be created. Using this class you can - easily extend functionality provided by built-in declarations. - -6. Sometimes, there is a need to find a declaration that match some criteria. - The was such functionality in `pygccxml`_, but it was too limited. This - release fix the situation. `pygccxml`_ adds a set of classes that will help - you to deal with this problem. - -7. New cache - ``parser.directory_cache_t`` has been implemented. - ``parser.directory_cache_t`` uses individual files stored in a dedicated - cache directory to store the cached contents. - Thanks to Matthias Baas! - -8. ``parser.file_cache_t`` has been improved a lot. - Thanks to Allen Bierbaum! - -9. New file configuration is available: "cached source file". - ``parser.project_reader_t`` class will check for existence of `GCC-XML`_ - generated file. If it does not exist it will create one. If it do exist, - then that file will be used by the parser. - -10. Few helper functions has been added in order to make construction of - configuration file to be as easy as possible: - - * ``parser.create_text_fc`` - creates file configuration, that contains text - * ``parser.create_source_fc`` - creates file configuration, that contains - reference to regular source file - * ``parser.create_gccxml_fc`` - creates file configuration, that contains - reference to `GCC-XML`_ generated file - * ``parser.create_cached_source_fc`` - creates file configuration, that - contains reference to 2 files: `GCC-XML`_ generated file and regular source - file - -11. Small bug fixes. - -12. Documentation. Allen Bierbaum and Matthias Baas contributed so much in this - area. Almost every public function/class has now documentation string. - -13. Logging functionality has been added. `pygccxml`_ creates new logger - "pygccxml". Now it is possible to see what `pygccxml`_ is doing right now. - -14. I am sure I forgot something. - - -------------- -Version 0.6.9 -------------- - -1. New functions: - - * *type_traits.is_void_pointer* - - * *type_traits.array_size* - - * *type_traits.array_item_type* - -2. Class *declarations.variable_t* has new property - *bit_fields* - -3. Now it is possible to specify "undefined" directives using - *parser.config_t* class. - -4. *patch* functionality has been introduced. `GCC-XML`_ generates wrong - default values for function arguments. *patch* functionality tries to fix - this. - -5. Small bug fixes - -------------- -Version 0.6.8 -------------- - -1. Small bug has been fixed. - -------------- -Version 0.6.7 -------------- - -1. New functions: - - * *type_traits.remove_pointer* - - * *type_traits.base_type* - - * *type_traits.is_convertible* - -2. A lot of small bug fixes. - -3. Few English mistakes have been fixed. - - .. attention:: - - There are 2 none backward compatible changes: - - * class with name **compaund_t** has been renamed to **compound_t** - - * word **pathes** has been replaced with **paths** - -4. There are new properties on - - * *declarations.declaration_t.top_parent* - - * *declarations.class_t.recursive_bases* returns all base classes of the - class - - * *declarations.class_t.recursive_derived* returns all derived classes of - the class - - * *member_calldef_t.access_type* - -5. New type has been introduced: *unknown_t*. There are use cases when - `GCC-XML`_ does not returns function return type. - -6. New implementation of *make_flatten* algorithm using generators. - By default old implementation will be used. - -7. *parser.file_configuration_t* interface has been changed. Now it is able - to keep: source file, text or `GCC-XML`_ generated file. If you are doing - something with code that is not changing you'd better use `GCC-XML`_ - generated file as content of the *parser.file_configuration_t*. Save your - time. - -8. There are some cases when `GCC-XML`_ reports *"restricted"*. In this case - `pygccxml`_ replaces *"restricted"* with *"volatile"*. - - -.. _`pygccxml`: ./../pygccxml.html -.. _`SourceForge`: http://sourceforge.net/index.php -.. _`GCC-XML`: http://www.gccxml.org -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: \ No newline at end of file +6. ``declarations.class_t`` has new property - ``aliases``. This is a list of + all class aliases. + +7. Bug fixes. + +8. Documentation has been updated/written/improved. + +------------- +Version 0.7.1 +------------- + +**Attention - this going to be last version that is tested with Python 2.3** + +1. New fundamental types has been added + + * complex float + + * complex double + + * complex long double + +2. **Attention - non backward compatible change** + + ``declarations.filtering.user_defined`` and ``declarations.filtering.by_location`` + implementation has been changed. In previous version of those functions, + ``decls`` list has been changed in place. This was wrong behavior. Now, + those functions will return new list, which contains all desired declarations. + +3. Few new type traits has been added + + * *type_traits.has_destructor* + + * *type_traits.has_public_destructor* + + * *type_traits.has_public_constructor* + + * *type_traits.is_noncopyable* + +4. ``decl_printer_t`` class and ``print_declarations`` function have been added. + Now you can print in a nice way your declaration tree or part of it. + Thanks to Allen Bierbaum! + +5. New class ``declarations.decl_factory_t`` has been added. This is a default + factory for all declarations. From now all relevant parser classes takes as + input instance of this class or ``Null``. In case of ``Null`` instance of + ``declarations.decl_factory_t`` will be created. Using this class you can + easily extend functionality provided by built-in declarations. + +6. Sometimes, there is a need to find a declaration that match some criteria. + The was such functionality in `pygccxml`_, but it was too limited. This + release fix the situation. `pygccxml`_ adds a set of classes that will help + you to deal with this problem. + +7. New cache - ``parser.directory_cache_t`` has been implemented. + ``parser.directory_cache_t`` uses individual files stored in a dedicated + cache directory to store the cached contents. + Thanks to Matthias Baas! + +8. ``parser.file_cache_t`` has been improved a lot. + Thanks to Allen Bierbaum! + +9. New file configuration is available: "cached source file". + ``parser.project_reader_t`` class will check for existence of `GCC-XML`_ + generated file. If it does not exist it will create one. If it do exist, + then the parser will use that file. + +10. Few helper functions has been added in order to make construction of + configuration file to be as easy as possible: + + * ``parser.create_text_fc`` - creates file configuration, that contains text + * ``parser.create_source_fc`` - creates file configuration, that contains + reference to regular source file + * ``parser.create_gccxml_fc`` - creates file configuration, that contains + reference to `GCC-XML`_ generated file + * ``parser.create_cached_source_fc`` - creates file configuration, that + contains reference to 2 files: `GCC-XML`_ generated file and regular source + file + +11. Small bug fixes. + +12. Documentation. Allen Bierbaum and Matthias Baas contributed so much in this + area. Almost every public function/class has now documentation string. + +13. Logging functionality has been added. `pygccxml`_ creates new logger + "pygccxml". Now it is possible to see what `pygccxml`_ is doing right now. + +14. I am sure I forgot something. + + +------------- +Version 0.6.9 +------------- + +1. New functions: + + * *type_traits.is_void_pointer* + + * *type_traits.array_size* + + * *type_traits.array_item_type* + +2. Class *declarations.variable_t* has new property - *bit_fields* + +3. Now it is possible to specify "undefined" directives using + *parser.config_t* class. + +4. *patch* functionality has been introduced. `GCC-XML`_ generates wrong + default values for function arguments. *patch* functionality tries to fix + this. + +5. Small bug fixes + +------------- +Version 0.6.8 +------------- + +1. Small bug has been fixed. + +------------- +Version 0.6.7 +------------- + +1. New functions: + + * *type_traits.remove_pointer* + + * *type_traits.base_type* + + * *type_traits.is_convertible* + +2. A lot of small bug fixes. + +3. Few English mistakes have been fixed. + + .. attention:: + + There are 2 none backward compatible changes: + + * class with name **compaund_t** has been renamed to **compound_t** + + * word **pathes** has been replaced with **paths** + +4. There are new properties on + + * *declarations.declaration_t.top_parent* + + * *declarations.class_t.recursive_bases* returns all base classes of the + class + + * *declarations.class_t.recursive_derived* returns all derived classes of + the class + + * *member_calldef_t.access_type* + +5. New type has been introduced: *unknown_t*. There are use cases when + `GCC-XML`_ does not returns function return type. + +6. New implementation of *make_flatten* algorithm using generators. + By default old implementation will be used. + +7. *parser.file_configuration_t* interface has been changed. Now it is able + to keep: source file, text or `GCC-XML`_ generated file. If you are doing + something with code that is not changing you'd better use `GCC-XML`_ + generated file as content of the *parser.file_configuration_t*. Save your + time. + +8. There are some cases when `GCC-XML`_ reports *"restricted"*. In this case + `pygccxml`_ replaces *"restricted"* with *"volatile"*. + + +.. _`pygccxml`: ./../pygccxml.html +.. _`SourceForge`: http://sourceforge.net/index.php +.. _`GCC-XML`: http://www.gccxml.org +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + End: Modified: pygccxml_dev/docs/pygccxml.rest =================================================================== --- pygccxml_dev/docs/pygccxml.rest 2006-08-15 08:44:45 UTC (rev 404) +++ pygccxml_dev/docs/pygccxml.rest 2006-08-15 10:41:00 UTC (rev 405) @@ -1,144 +1,144 @@ -====================== -pygccxml documentation -====================== - -.. contents:: Table of contents - -.. meta:: - :description: C++ declarations parser - :keywords: C++, source code, header file, parser, UML, free, declarations - , XML, class hierarchy, analize, AST, code generator, - , синтаксический анализатор, исходный текст, исходная программа - , описание, определение, иерархия классов, генератор кода - ------------- -Introduction ------------- -.. include:: ./definition.rest - ----------------------- -What can I do with it? ----------------------- -Using `pygccxml`_ you can: - -* parse C++ source code -* build a code generator - - + `Py++`_ is heavily based on `pygccxml`_ - + generate `WSDL`_ file from sources - + ... - -* create UML diagrams -* build code analyzer -* ... - -------------- -Usage example -------------- -First of all let's see a small and simple `example`_. This example prints all -declarations, reported by `GCC-XML`_ after parsing `core_class_hierarchy.hpp`_ -file. Also it prints all clasess, and for every class it will print it's base -and derived classes. It was simple task, right? If you are still curious how it -looks "in the real life", I mean how xml file is look like, you may look at the -`original XML file`_ generated by `GCC-XML`_. - -.. _`original XML file` : ./example/core_class_hierarchy.hpp.xml -.. _`core_class_hierarchy.hpp` : ./example/core_class_hierarchy.hpp -.. _`example` : ./example/example.py - --------- -Features --------- - -Caching -------- - -Consider the following situation: you have to parse the same set of files every -day. There are 2 possibile ways to complete the task: - -* create a header file that includes all files you need to parse - -* parse each file separately and then join the results - -The difference between these approaches is the caching algorithm used in the -second case. `pygccxml`_ supports both of them. - -Type traits ------------ - -`pygccxml`_ provides a lot of functionality to analize C++ types and relationship -between them. For more information please refer to `design`__ document or API -documentation. Just a few names of algorithms: - -* ``is_convertible( from, to )`` - - returns ``True`` if there is a conversion from type ``from`` to type ``to``, - otherwise ``False`` - -* ``is_unary_operator( oper )`` - - returns ``True`` if ``oper`` describes unary operator - -.. __: ./design.html - - -Query interface ---------------- - -`pygccxml`_ provides simple and powerful API to query declarations tree. I will -try to give small example, that will prove my point. If you want to know more -about provided API please read `query interface`__ document or API documentation. -Examples: -:: - - #global_ns is the reference to declarations that describes C++ namespace. - #In our case, instance of that declarations describes global ( :: ) namespace. - global_ns.free_functions( "do_smth", return_type='void', arg_types=[None,'int'] ) - - -Small explanation. Assume that ``None`` means "any type". Now the code is pretty -readable: -:: - - select all free functions - where - name equal to "do_smth" - return type is void - function has two arguments - second argument type is int - -.. __: ./query_interface.html - -------- -License -------- - -`Boost Software License`_. - ------------------ -Test environments ------------------ - -`pygccxml`_ comes with comprehensive unit tests. It is running on Windows XP and -`Ubuntu`_. I am using `Python`_ 2.4 and `GCC-XML`_ CVS. -Right now I am running more then 100 tests. They test almost every piece of code. -Also I have performance tests. Most of the time I am using "white box" testing -strategy. - -.. _`WSDL`: http://www.w3.org/TR/wsdl -.. _`Py++`: ./../pyplusplus/pyplusplus.html -.. _`pygccxml`: ./pygccxml.html -.. _`SourceForge`: http://sourceforge.net/index.php -.. _`Docutils`: http://docutils.sourceforge.net -.. _`Python`: http://www.python.org -.. _`GCC-XML`: http://www.gccxml.org -.. _`Boost Software License`: http://boost.org/more/license_info.html -.. _`Ubuntu`: http://www.ubuntu.com/ -.. _`boost::type_traits` : http://www.boost.org/libs/type_traits/index.html -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: \ No newline at end of file +====================== +pygccxml documentation +====================== + +.. contents:: Table of contents + +.. meta:: + :description: C++ declarations parser + :keywords: C++, source code, header file, parser, UML, free, declarations + , XML, class hierarchy, analyze, AST, code generator, + , синтаксический анализатор, исходный текст, исходная программа + , описание, определение, иерархия классов, генератор кода + +------------ +Introduction +------------ +.. include:: ./definition.rest + +---------------------- +What can I do with it? +---------------------- +Using `pygccxml`_ you can: + +* parse C++ source code +* build a code generator + + + `Py++`_ is heavily based on `pygccxml`_ + + generate `WSDL`_ file from sources + + ... + +* create UML diagrams +* build code analyzer +* ... + +------------- +Usage example +------------- +First of all let's see a small and simple `example`_. This example prints all +declarations, reported by `GCC-XML`_ after parsing `core_class_hierarchy.hpp`_ +file. Also it prints all classes, and for every class it will print it's base +and derived classes. It was simple task, right? If you are still curious how it +looks "in the real life", I mean how xml file is look like, you may look at the +`original XML file`_ generated by `GCC-XML`_. + +.. _`original XML file` : ./example/core_class_hierarchy.hpp.xml +.. _`core_class_hierarchy.hpp` : ./example/core_class_hierarchy.hpp +.. _`example` : ./example/example.py + +-------- +Features +-------- + +Caching +------- + +Consider the following situation: you have to parse the same set of files every +day. There are 2 possible ways to complete the task: + +* create a header file that includes all files you need to parse + +* parse each file separately and then join the results + +The difference between these approaches is the caching algorithm used in the +second case. `pygccxml`_ supports both of them. + +Type traits +----------- + +`pygccxml`_ provides a lot of functionality to analyze C++ types and relationship +between them. For more information please refer to `design`__ document or API +documentation. Just a few names of algorithms: + +* ``is_convertible( from, to )`` + + returns ``True`` if there is a conversion from type ``from`` to type ``to``, + otherwise ``False`` + +* ``is_unary_operator( oper )`` + + returns ``True`` if ``oper`` describes unary operator + +.. __: ./design.html + + +Query interface +--------------- + +`pygccxml`_ provides simple and powerful API to query declarations tree. I will +try to give small example, that will prove my point. If you want to know more +about provided API please read `query interface`__ document or API documentation. +Examples: +:: + + #global_ns is the reference to declarations that describes C++ namespace. + #In our case, instance of that declarations describes global ( :: ) namespace. + global_ns.free_functions( "do_smth", return_type='void', arg_types=[None,'int'] ) + + +Small explanation. Assume that ``None`` means "any type". Now the code is pretty +readable: +:: + + select all free functions + where + name equal to "do_smth" + return type is void + function has two arguments + second argument type is int + +.. __: ./query_interface.html + +------- +License +------- + +`Boost Software License`_. + +----------------- +Test environments +----------------- + +`pygccxml`_ comes with comprehensive unit tests. It is running on Windows XP and +`Ubuntu`_. I am using `Python`_ 2.4 and `GCC-XML`_ CVS. +Right now I am running more then 150 tests. They test almost every piece of code. +Also I have performance tests. Most of the time I am using "white box" testing +strategy. + +.. _`WSDL`: http://www.w3.org/TR/wsdl +.. _`Py++`: ./../pyplusplus/pyplusplus.html +.. _`pygccxml`: ./pygccxml.html +.. _`SourceForge`: http://sourceforge.net/index.php +.. _`Docutils`: http://docutils.sourceforge.net +.. _`Python`: http://www.python.org +.. _`GCC-XML`: http://www.gccxml.org +.. _`Boost Software License`: http://boost.org/more/license_info.html +.. _`Ubuntu`: http://www.ubuntu.com/ +.. _`boost::type_traits` : http://www.boost.org/libs/type_traits/index.html +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + End: Modified: pygccxml_dev/docs/query_interface.rest =================================================================== --- pygccxml_dev/docs/query_interface.rest 2006-08-15 08:44:45 UTC (rev 404) +++ pygccxml_dev/docs/query_interface.rest 2006-08-15 10:41:00 UTC (rev 405) @@ -1,287 +1,287 @@ -=============================== -pygccxml.declarations query API -=============================== - -.. contents:: Table of contents - ------------- -Introduction ------------- -You parsed the source files. Now you have to do some real work with the extracted -information, right? `pygccxml`_ provides very powerful and simple interface to -query about extracted declarations. - -Just an example. I want to select all member functions, that have 2 arguments. -I don't care about first argument type, but I do want second argument type to be -a reference to an integer. More over, I want those functions names to end with -"impl" string and they should be protected or private. -:: - - #global_ns is the reference to an instance of namespace_t object, that - #represents global namespace - query = declarations.custom_matcher_t( lambda mem_fun: mem_fun.name.endswith( 'impl' ) - query = query & ~declarations.access_type_matcher_t( 'public' ) - global_ns.member_functions( function=query, arg_types=[None, 'int &'] ) - -The example is complex, but still readable. In many cases you will find your -self looking for one or many declarations using one or two properties of that -declaration(s). For example: -:: - - global_ns.namespaces( 'details' ) - -This call will return all namespaces with name 'details'. - --------------- -User interface --------------- - -As you already know, ``pygccxml.declarations`` package defines next classes: - -* ``scopedef_t`` - base class for all classes, that can contain other declarations - -* ``namespace_t`` - derives from ``scopedef_t`` class, represents C++ namespace - -* ``class_t`` - derives from ``scopedef_t`` class, represents C++ class/struct/union. - -So, the query methods defined on ``scopedef_t`` class could be used on instances -of ``class_t`` and ``namespace_t`` classes. I am sure you knew that. - -Usage examples --------------- - -I will explain the usage of ``member_function`` and ``member_functions`` methods. -The usage of other methods is very similar to them. Here is definition of those -methods: -:: - - def member_function( self, - ... [truncated message content] |
From: <rom...@us...> - 2006-08-15 08:44:53
|
Revision: 404 Author: roman_yakovenko Date: 2006-08-15 01:44:45 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=404&view=rev Log Message: ----------- architecture.rest document is finished Modified Paths: -------------- pyplusplus_dev/docs/documentation/architecture.rest Modified: pyplusplus_dev/docs/documentation/architecture.rest =================================================================== --- pyplusplus_dev/docs/documentation/architecture.rest 2006-08-15 06:49:56 UTC (rev 403) +++ pyplusplus_dev/docs/documentation/architecture.rest 2006-08-15 08:44:45 UTC (rev 404) @@ -157,8 +157,8 @@ ``Code creators`` and file writers provides solution for both problems. -Code creators -------------- +``Code creators`` +----------------- Do you know how many ways exist to export member function? If you will try to answer the question, consider next function characteristics and their mix: @@ -239,8 +239,8 @@ return os.linesep.join( result ) -Code creators tree -~~~~~~~~~~~~~~~~~~ +``Code creators tree`` +~~~~~~~~~~~~~~~~~~~~~~ ``code_creators.module_t`` class is a top level ``code creator``. Take a look on next possible "snapshot" of the ``code creators tree``: @@ -266,8 +266,8 @@ .. _`AST`: http://en.wikipedia.org/wiki/Abstract_syntax_tree -Code creators tree construction -------------------------------- +``Code creators tree`` construction +----------------------------------- ``pyplusplus.module_creator`` package is responsible for the tree construction. ``pyplusplus.module_creator.creator_t`` is the main class of the package. It @@ -289,26 +289,45 @@ * find out std containers, that should be exported * warn user, if some declaration is not exported and it used somewhere in - exported declarations ( **to be implemented pretty soon** ) + exported declarations ( **not implemented** ) -File writers ------------- +``File writers`` +---------------- -``File writers`` classes are responsible for writting ``code creators tree`` into -files. `Py++`_ implements few strategies of writting ``code creators tree`` -into file(s): +``File writers`` classes are responsible for writting ``code creators tree`` into +the files. `Py++`_ implements next strategies of writting ``code creators tree`` +into files: -* all source code will be written in single file +* single file -* all source code will be written in multiple files +* multiple files - provides a solution to `compilation time and memory usage problem`_ - * huge classes will be written in multiple files + .. _`compilation time and memory usage problem` : http://www.boost.org/libs/python/doc/v2/faq.html#slow_compilation +* multiple files, with huge classes are written into multiple files - provides a + solution for `compiler limit`_ problem. + + .. _`compiler limit` : http://www.boost.org/libs/python/doc/v2/faq.html#c1204 +The more sophisticated approach, the better understanding of ``code creators`` +is required from the ``file writers``. +-------------------------- +``module_builder`` package +-------------------------- +This package provides an interface to all code generator engine services. + +---------- +Conclusion +---------- + +It safe to use `Py++`_ for big and small projects! + +.. _`open-closed principle` : http://www.google.com/search?sourceid=gmail&q=open%20closed%20principle + .. _`Py++` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-15 06:50:06
|
Revision: 403 Author: roman_yakovenko Date: 2006-08-14 23:49:56 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=403&view=rev Log Message: ----------- updating documentation Modified Paths: -------------- pyplusplus_dev/docs/documentation/architecture.rest Modified: pyplusplus_dev/docs/documentation/architecture.rest =================================================================== --- pyplusplus_dev/docs/documentation/architecture.rest 2006-08-14 19:47:23 UTC (rev 402) +++ pyplusplus_dev/docs/documentation/architecture.rest 2006-08-15 06:49:56 UTC (rev 403) @@ -10,15 +10,18 @@ This document will describe an architecture behind `Py++`_. ---- +--------------------------- +Py++ & pygccxml integration +--------------------------- + C++ --- C++ is very powerful programming language. The power brings complexity. It is not an easy task to parse C++ source files and to create in memory representation -of declarations tree. Lets say that I've managed to do it. It is not enough. The -declarations tree is worth nothing, if a user is not able to explorer it, to run -queries against it or to find out traits of a declaration or a type. +of declarations tree. The declarations tree is worth nothing, if a user is not +able to explorer it, to run queries against it or to find out traits of a +declaration or a type. On the earlier stage of the development, I realized, that all this functionality does not belong to code generator and should be implemented out side of it. @@ -46,13 +49,13 @@ * ... -Py++ & pygccxml integration ---------------------------- +Integration details +------------------- `Py++`_ uses different approaches to expose these services to the user. Parsing integration -------------------- +~~~~~~~~~~~~~~~~~~~ `Py++`_ provides it's own "API" to configure `pygccxml`_ parsing services. The "API" I am talking about, is arguments to ``module_builder.__init__`` method. @@ -60,7 +63,7 @@ Declarations tree integration ------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Declarations tree API consists from 3 parts: @@ -76,10 +79,11 @@ The user should be familiar with these parts and relevant API. In my opinion, -wrapping\\hidding\\modifying the API will not provide an additonal value. The -interface of all those services is pretty simple and well polished. +wrapping or hidding the API will not provide an additonal value. The interface +of all those services is pretty simple and well polished. -Please take a look on next source code: +Before I explain how these services are integrated, take a look on next source +code: :: @@ -116,13 +120,13 @@ 2. ``pyplusplus.decl_wrappers`` package defines classes, that derive from ``pygccxml.declarations`` classes and defines the factory. -The implemented solution is not the simplest one, it provides an additional value -to the project: +The implemented solution is not the simplest one, but it provides an additional +value to the project: * the code generation engine configuration and declarations tree are tightly coupled -* all functionality provided by ``pygccxml.declarations`` and ``pygccxml.parser`` +* the functionality provided by ``pygccxml.declarations`` and ``pygccxml.parser`` packages is available for ``pyplusplus.decl_wrappers`` classes * classes defined in ``pyplusplus.decl_wrappers`` package implement next @@ -139,8 +143,8 @@ Code generation engine ---------------------- -Code generation for `Boost.Python`_ library is a difficult process. After small -analizes I understood, that there are 2 different problems the engine should solve: +Code generation for `Boost.Python`_ library is a difficult process. There are two +different problems the engine should solve: .. _`divide and conquer` : http://en.wikipedia.org/wiki/Divide_and_conquer_algorithm @@ -151,36 +155,36 @@ Remember, `Py++`_ is targeting big projects. It can not generate all code in one file - this will not work, not at all. -Code creators and file writers provides solution to both problems. - +``Code creators`` and file writers provides solution for both problems. Code creators ------------- -Do you know how many ways exist to export member function? It is up to you to -find the answer to the question. Please consider next function properties and -their mix: +Do you know how many ways exist to export member function? If you will try to +answer the question, consider next function characteristics and their mix: -* function is non virtual, virtual or pure virtual +* virtuality( non virtual, virtual or pure virtual ) -* function is public, protected or private +* access level( public, protected or private ) -* function could be static +* static\\non static -* function could be an ``operator()`` or an ``operator[]`` +* overloads -* function could be overloaded +As you see, there are a lot of use cases. How do ``code creators`` solve the problem? -As you see, there are a lot of use cases. How does ``code creator``'s solve the -problem? There is almost a direct mapping between ``code creator``'s and use cases. -``Code creator`` knows what code should be created, in order to export a -declaration. That is the only job of ``code creator``. For example: +Definition +~~~~~~~~~~ +``Code creator`` is an in-memory fragment of a C++ code. + +Also, ``code creator`` can represent an arbitrary C++ code, in practice it +represents logically complete block. + +Example of ``code creators``: + * ``code_creators.enum_t`` generates registration code for an enumeration -* ``code_creators.indexing_suite2_t`` generates registration code for an stl - containers - * ``code_creators.mem_fun_pv_t`` generates registration code for public, pure virtual function @@ -192,14 +196,17 @@ * ``code_creators.custom_text_t`` adds some custom( read user ) text\\code to the generated code -As you can see, there are primary 2 kinds of ``code creator``'s: declaration -based and others. Declaration based creator generates code, that is needed to -export the declaration. There a lot of use cases, where in order to export a -declaration, `Py++`_ builds more then one ``code creator``. For example: -in order to export virtual function 2 ``code creator``'s are built: +There are primary two groups of ``code creators``: declaration based and others. -( I will reuse example from `Boost.Python`_ `tutorials`__.) +Declaration based ``code creator`` keeps reference to the declaration ( +``pyplusplus.decl_wrapper.*`` class instance ). During code generation process, +it reads its settings( the code generation engine instructions ) from the +declaration. Declaration based ``code creators`` also divided into two groups. +The first group creates registration code, where the second one creates +wrapper\\helper declaration code. +I will reuse `this example`__, from `Boost.Python`_ tutorials. + .. __ : http://boost.org/libs/python/doc/tutorial/doc/html/python/exposing.html#python.virtual_functions_with_default_implementations 1. ``BaseWrap::f``, ``BaseWrap::default_f`` - declaration code is created by @@ -209,16 +216,8 @@ code creator also keeps reference to the relevant instance of ``code_creators.mem_fun_v_wrapper_t`` class. - -Declaration based ``code creator`` keeps reference to the declaration ( -``pyplusplus.decl_wrapper.*`` class instance ). During code creation process, -``code creator`` reads its settings( the code generation engine instructions ) -from the declaration. - -``Code creator``'s are the only classes, that generate the code! - Composite ``code creator`` is a creator, that contains other creators. Composite -``code creator`` embeds the code, created by internal ``code creator``'s, within +``code creator`` embeds the code, created by internal ``code creators``, within the code it creates. For example: * ``code_creators.class_t``: @@ -243,9 +242,8 @@ Code creators tree ~~~~~~~~~~~~~~~~~~ -``code_creators.module_t`` code creator is a top level code creator. It is a -composite ``code creator`` too. Take a look on next possible "snapshot" of the -``code creators tree``: +``code_creators.module_t`` class is a top level ``code creator``. Take a look on +next possible "snapshot" of the ``code creators tree``: :: @@ -264,52 +262,53 @@ <free_function_t ...> <...> -I hope, now you understand the termine ``code creators tree``. You can think -about code creator's tree as some kind of `AST`_. +You can think about ``code creators tree`` as some kind of `AST`_. .. _`AST`: http://en.wikipedia.org/wiki/Abstract_syntax_tree Code creators tree construction ------------------------------- + +``pyplusplus.module_creator`` package is responsible for the tree construction. +``pyplusplus.module_creator.creator_t`` is the main class of the package. It +creates the tree in few steps: + +1. It builds set of exposed declarations. +2. It sort the set. `Boost.Python`_ has few rules, that forces the user to export + a declaration before another one. +3. It creates ``code creators`` and put them into the right place within the tree. +4. If a declaration describes C++ class, it applies these steps to it. -``pyplusplus.module_creator.creator_t`` class is responsible for the task. As -input it gets whole declarations tree. Extracts all declarations that should be -exported and sorts them. After this it constructs ``code creators tree``. +Another responsibility of ``creator_t`` class, is to analize declarations and +their dependency graphs. As a result, this class can: -Another responsibility of the class, is to analize declarations and their -dependency graphs. Today, only limited subset of the functionality is implemented: - * find out a class ``HeldType`` * find out smart pointers conversion, that should be registered * find out std containers, that should be exported + +* warn user, if some declaration is not exported and it used somewhere in + exported declarations ( **to be implemented pretty soon** ) -Next functionality is still missing: if some declaration is not exported and -it used somewhere in exported declarations, `Py++`_ will warn user. - - + File writers ------------ -``File writer``'s classes is responcible for writting `code creators tree`` into -files. Lets take a look on few lines of code from ``file_writers.single_file_t`` -class. - -:: - - ... - #write_file will write the code to file only if needed. - #extmodule is an instance of code_creators.module_t class - self.write_file( self.file_name, self.extmodule.create() ) - # ^^^^^^^^^^^^^^^^^^^^^^^ - -``single_file_t`` does not know any ``code creator``, except the ``module_t``! - -``File writer``'s do not know and will not know all ``code creator``'s. +``File writers`` classes are responsible for writting ``code creators tree`` into +files. `Py++`_ implements few strategies of writting ``code creators tree`` +into file(s): +* all source code will be written in single file +* all source code will be written in multiple files + * huge classes will be written in multiple files + + + + + .. _`Py++` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-14 19:47:32
|
Revision: 402 Author: roman_yakovenko Date: 2006-08-14 12:47:23 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=402&view=rev Log Message: ----------- updating docs Modified Paths: -------------- pyplusplus_dev/docs/documentation/architecture.rest pyplusplus_dev/docs/pyplusplus.rest Modified: pyplusplus_dev/docs/documentation/architecture.rest =================================================================== --- pyplusplus_dev/docs/documentation/architecture.rest 2006-08-14 12:47:13 UTC (rev 401) +++ pyplusplus_dev/docs/documentation/architecture.rest 2006-08-14 19:47:23 UTC (rev 402) @@ -16,9 +16,9 @@ C++ is very powerful programming language. The power brings complexity. It is not an easy task to parse C++ source files and to create in memory representation -of declarations tree. Lets say that I've managed to do it. It is not enough. -Declarations tree is worth nothing, if a user is not able to explorer it, to run -queries against it, to find out traits of a declaration or a type. +of declarations tree. Lets say that I've managed to do it. It is not enough. The +declarations tree is worth nothing, if a user is not able to explorer it, to run +queries against it or to find out traits of a declaration or a type. On the earlier stage of the development, I realized, that all this functionality does not belong to code generator and should be implemented out side of it. @@ -52,15 +52,16 @@ `Py++`_ uses different approaches to expose these services to the user. Parsing integration -------------------- -`Py++`_ provides it's own "API" to configure and run `pygccxml`_ parsing -services. The "API" I am talking about, is arguments to ``module_builder.__init__`` -method. The method takes all arguments, needed to envoke parsing services. It -has been done this way to simplify the usage of `Py++`_. +------------------- +`Py++`_ provides it's own "API" to configure `pygccxml`_ parsing services. The +"API" I am talking about, is arguments to ``module_builder.__init__`` method. +We think, that exposing those services via `Py++`_ simplifies its usage. + Declarations tree integration ----------------------------- + Declarations tree API consists from 3 parts: * interface definition: @@ -72,16 +73,14 @@ * type traits * query engine API + +The user should be familiar with these parts and relevant API. In my opinion, +wrapping\\hidding\\modifying the API will not provide an additonal value. The +interface of all those services is pretty simple and well polished. -The user should be familiar with these part and relevant API of `pygccxml`_ project. -The reason is simple: in my opinion, wrapping/hidding/modifying the API will not -provide an additonal value. The interface of all those services is pretty simple -and well polished. +Please take a look on next source code: -The question you should ask now is: how is this API integrated? Before I start to -explain, lets take a look on next source code: - :: mb = module_builder_t( ... ) @@ -106,9 +105,7 @@ What is the point of this example? From the user point of view it is perfectly good, it makes a lot of sence to configure the code generation engine, using -the declarations tree. Now, the desired solution is clear: we should use -declarations tree to configure the engine. So, let me to re-formulate the -question: how does `Py++`_ add missinig functionality to +the declarations tree. How does `Py++`_ add missinig functionality to ``pygccxml.declarations`` classes? There were few possible solutions to the problem. The next one was implemented: @@ -119,8 +116,8 @@ 2. ``pyplusplus.decl_wrappers`` package defines classes, that derive from ``pygccxml.declarations`` classes and defines the factory. -Also, this solution is not the simplest one, it provides an additional value to -the project: +The implemented solution is not the simplest one, it provides an additional value +to the project: * the code generation engine configuration and declarations tree are tightly coupled @@ -142,25 +139,19 @@ Code generation engine ---------------------- -Code generation for `Boost.Python`_ library is a difficult process. It is very -difficult to solve it as is. I prefer to apply `divide and conquer`_ paradigm. -There are 2 different problems the engine should solve: +Code generation for `Boost.Python`_ library is a difficult process. After small +analizes I understood, that there are 2 different problems the engine should solve: .. _`divide and conquer` : http://en.wikipedia.org/wiki/Divide_and_conquer_algorithm * What code should be created in order to export a declaration? - I mean what `Boost.Python`_ code should be generated if you want to export this - or that declaration. - - Code creators is the solution to this problem. - * How it should be written to files? Remember, `Py++`_ is targeting big projects. It can not generate all code in one file - this will not work, not at all. - Code creators and file writers provides solution to this problem. +Code creators and file writers provides solution to both problems. Code creators @@ -182,7 +173,7 @@ As you see, there are a lot of use cases. How does ``code creator``'s solve the problem? There is almost a direct mapping between ``code creator``'s and use cases. -``Code creator`` knows what code should be generated, in order to export a +``Code creator`` knows what code should be created, in order to export a declaration. That is the only job of ``code creator``. For example: * ``code_creators.enum_t`` generates registration code for an enumeration @@ -211,16 +202,19 @@ .. __ : http://boost.org/libs/python/doc/tutorial/doc/html/python/exposing.html#python.virtual_functions_with_default_implementations -1. ``BaseWrap::f``, ``BaseWrap::default_f`` - ``code_creators.mem_fun_v_wrapper_t`` +1. ``BaseWrap::f``, ``BaseWrap::default_f`` - declaration code is created by + ``code_creators.mem_fun_v_wrapper_t`` -2. ``f`` registration code - ``code_creators.mem_fun_v_t`` - +2. ``f`` registration code is created by ``code_creators.mem_fun_v_t``. This + code creator also keeps reference to the relevant instance of + ``code_creators.mem_fun_v_wrapper_t`` class. -Reminder: classes, defined in ``pyplusplus.decl_wrappers`` package, are used as -configuration to ``code creator``. So, ``code creator`` keeps reference to -declaration and when it is requested to generate code, it does this according -to the declaration configuration. +Declaration based ``code creator`` keeps reference to the declaration ( +``pyplusplus.decl_wrapper.*`` class instance ). During code creation process, +``code creator`` reads its settings( the code generation engine instructions ) +from the declaration. + ``Code creator``'s are the only classes, that generate the code! Composite ``code creator`` is a creator, that contains other creators. Composite @@ -270,32 +264,31 @@ <free_function_t ...> <...> -I hope, now you understand the termine ``code creators tree``. +I hope, now you understand the termine ``code creators tree``. You can think +about code creator's tree as some kind of `AST`_. +.. _`AST`: http://en.wikipedia.org/wiki/Abstract_syntax_tree + Code creators tree construction ------------------------------- -``pygccxml.declarations`` package defines declarations visitor class. -``pyplusplus.module_creator.creator_t`` class derives from this class. Its main -job is to create ``code creators tree``. You can think about this class as a -big "switch-case" statement. This is the only class that fully "understands" -declarations and ``code creators``. It reads a declaration and then constructs -one or more ``code creator``'s and put them into the tree. +``pyplusplus.module_creator.creator_t`` class is responsible for the task. As +input it gets whole declarations tree. Extracts all declarations that should be +exported and sorts them. After this it constructs ``code creators tree``. -There is one interesting thing about this class you should know: this is the only -class that "sees" all declarations. It monitors all exported functions and -variables. Thus it knows that class ``X`` is used with ``boost::shared_ptr``, -so it will set ``class_<X>`` ``HeldType`` to be ``boost::shared_ptr`` or will -register its usage. Another interesting example is std containers. You don't have -to say to `Py++`_ to export them, it will do it by itself. You may ask -why this detail is so interesting? Because the user does not have to specify all -set of declarations he wants to export! Because, in near future, `Py++`_ -will analize declarations dependency graph of exported declarations. If some -declaration should be exported and it is not, then `Py++`_ will warn the -user. +Another responsibility of the class, is to analize declarations and their +dependency graphs. Today, only limited subset of the functionality is implemented: +* find out a class ``HeldType`` +* find out smart pointers conversion, that should be registered +* find out std containers, that should be exported + +Next functionality is still missing: if some declaration is not exported and +it used somewhere in exported declarations, `Py++`_ will warn user. + + File writers ------------ Modified: pyplusplus_dev/docs/pyplusplus.rest =================================================================== --- pyplusplus_dev/docs/pyplusplus.rest 2006-08-14 12:47:13 UTC (rev 401) +++ pyplusplus_dev/docs/pyplusplus.rest 2006-08-14 19:47:23 UTC (rev 402) @@ -97,9 +97,9 @@ you use or know, that allow you to put your code any where or to reorder generated code as you wish? Py++ allows you to do that. -Py++ introduces new concept: code creator and code creator's tree. -You can think about code creator's tree as some kind of `AST`_. The only difference -is that code creator's tree has higher interface. For example ``include_t`` code +Py++ introduces new concept: code creator and code creators tree. You can think +about code creators tree as some kind of `AST`_. The only difference is that code +creators tree provides more specific functionality. For example ``include_t`` code creator is responsible to create C++ ``include`` directive code. You have full control over code creators tree, before it is written to disc. Here you can find UML diagram of almost all code creators: `class diagram`_. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-14 12:47:55
|
Revision: 401 Author: roman_yakovenko Date: 2006-08-14 05:47:13 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=401&view=rev Log Message: ----------- renaming pyplusplus to Py++ Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/decl_printer.py pygccxml_dev/unittests/autoconfig.py pygccxml_dev/unittests/data/core_cache.hpp pyplusplus_dev/docs/examples/boost/www_configuration.py pyplusplus_dev/examples/pyboost_dev/dev/date_time/generate_code.py pyplusplus_dev/pyplusplus/__init__.py pyplusplus_dev/pyplusplus/_logging_/__init__.py pyplusplus_dev/pyplusplus/decl_wrappers/__init__.py pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py pyplusplus_dev/pyplusplus/file_writers/writer.py pyplusplus_dev/pyplusplus/gui/__init__.py pyplusplus_dev/pyplusplus/gui/ui.py pyplusplus_dev/pyplusplus/module_builder/__init__.py pyplusplus_dev/pyplusplus/module_builder/builder.py pyplusplus_dev/pyplusplus/module_creator/class_organizer.py pyplusplus_dev/pyplusplus/module_creator/creator.py pyplusplus_dev/pyplusplus/module_creator/types_database.py pyplusplus_dev/setup.py Modified: pygccxml_dev/pygccxml/declarations/decl_printer.py =================================================================== --- pygccxml_dev/pygccxml/declarations/decl_printer.py 2006-08-14 10:10:54 UTC (rev 400) +++ pygccxml_dev/pygccxml/declarations/decl_printer.py 2006-08-14 12:47:13 UTC (rev 401) @@ -14,7 +14,7 @@ This class provides more information than the __str__() methods do. The class is not just meant to provide a unique "id" for a declaration but to inspect an entire declaration tree. This is particularly useful - for new users who want to find out how pyplusplus works and how it + for new users who want to find out how Py++ works and how it stores its data. """ JUSTIFY = 20 Modified: pygccxml_dev/unittests/autoconfig.py =================================================================== --- pygccxml_dev/unittests/autoconfig.py 2006-08-14 10:10:54 UTC (rev 400) +++ pygccxml_dev/unittests/autoconfig.py 2006-08-14 12:47:13 UTC (rev 401) @@ -66,7 +66,7 @@ #, 'dat'#file extension of directory cache #, 'config'#parameter description #, 'gccxml'#parameter description - #, 'pyplusplus' + #, 'Py++' #, 'pygccxml' #, 'calldef' #, 'XXX' Modified: pygccxml_dev/unittests/data/core_cache.hpp =================================================================== --- pygccxml_dev/unittests/data/core_cache.hpp 2006-08-14 10:10:54 UTC (rev 400) +++ pygccxml_dev/unittests/data/core_cache.hpp 2006-08-14 12:47:13 UTC (rev 401) @@ -22,4 +22,4 @@ #endif//__core_cache_hpp__ -//touch//touch//touch//touch//touch//touch//touch \ No newline at end of file +//touch//touch//touch//touch//touch//touch//touch//touch \ No newline at end of file Modified: pyplusplus_dev/docs/examples/boost/www_configuration.py =================================================================== --- pyplusplus_dev/docs/examples/boost/www_configuration.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/docs/examples/boost/www_configuration.py 2006-08-14 12:47:13 UTC (rev 401) @@ -1,2 +1,2 @@ name = 'boost' -#This directory used as place holder for pyplusplus directory \ No newline at end of file +#This directory used as place holder for Py++ directory \ No newline at end of file Modified: pyplusplus_dev/examples/pyboost_dev/dev/date_time/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/dev/date_time/generate_code.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/examples/pyboost_dev/dev/date_time/generate_code.py 2006-08-14 12:47:13 UTC (rev 401) @@ -102,7 +102,7 @@ boost_ns.classes( lambda decl: decl.alias.endswith( 'formatter' ) ).exclude() #boost.date_time has problem to create local_[micro]sec_clock - #variable, it has nothing to do with pyplusplus + #variable, it has nothing to do with Py++ empty_classes = ['local_microsec_clock', 'local_sec_clock'] for alias in empty_classes: class_ = boost_ns.class_( lambda decl: decl.alias == alias ) Modified: pyplusplus_dev/pyplusplus/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/__init__.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/__init__.py 2006-08-14 12:47:13 UTC (rev 401) @@ -3,7 +3,7 @@ # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -"""pyplusplus - Boost.Python code generator +"""Py++ - Boost.Python code generator ======================================== This package (together with the accompanying pygccxml package and @@ -19,7 +19,7 @@ finally written into one or more C++ source files, which can then be compiled to generate the final Python module. -If you are just starting with U{pyplusplus<http://www.language-binding.net>}, +If you are just starting with U{Py++<http://www.language-binding.net>}, then consider to read documentation of L{module_builder} package. """ @@ -37,12 +37,8 @@ __version__ = '0.7.1' #Known issues: -#1. Generated code for exporting function of template intsantiated classes could not be compiled -# with visual studio 7.1 -#2. Add logging of some statistics -# #3. -#~ > > 2. An other difference: when pyplusplus creates bindings for a set of +#~ > > 2. An other difference: when Py++ creates bindings for a set of #~ > > declarations, it #~ > > should (?) see all declarations that are going to be exported: #~ > > reasons: Modified: pyplusplus_dev/pyplusplus/_logging_/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/_logging_/__init__.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/_logging_/__init__.py 2006-08-14 12:47:13 UTC (rev 401) @@ -5,7 +5,7 @@ #TODO: find better place for it """ -This package contains logging configuration for pyplusplus. Default log level +This package contains logging configuration for Py++. Default log level is DEBUG. Default log messages destination is sys.stdout. """ Modified: pyplusplus_dev/pyplusplus/decl_wrappers/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/__init__.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/decl_wrappers/__init__.py 2006-08-14 12:47:13 UTC (rev 401) @@ -5,7 +5,7 @@ """Declaration decorators. -This sub-package contains the pyplusplus specific declaration objects +This sub-package contains the Py++ specific declaration objects that are the nodes of the declaration tree. In addition to the interface of the declarations in the pygccxml package the objects in this package also provide a I{decoration} interface. This interface Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2006-08-14 12:47:13 UTC (rev 401) @@ -58,7 +58,7 @@ 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." ) + raise RuntimeError( "In order to expose pure virtual function, you should allow to Py++ to create wrapper." ) elif self.access_type == declarations.ACCESS_TYPES.PROTECTED: self.ignore = True else: @@ -112,12 +112,12 @@ dtype = units[-1] if isinstance( dtype.declaration.parent, declarations.class_t ): if dtype.declaration not in dtype.declaration.parent.public_members: - return "pyplusplus can not expose function that takes as argument/returns instance of non public class. Generated code will not compile." + return "Py++ can not expose function that takes as argument/returns instance of non public class. Generated code will not compile." no_ref = declarations.remove_reference( some_type ) no_ptr = declarations.remove_pointer( no_ref ) no_const = declarations.remove_const( no_ptr ) if declarations.is_array( no_const ): - return "pyplusplus can not expose function that takes as argument/returns C++ arrays. This will be changed in near future." + return "Py++ can not expose function that takes as argument/returns C++ arrays. This will be changed in near future." return self._exportable_impl_derived() def _readme_impl( self ): @@ -169,7 +169,7 @@ def _exportable_impl_derived( self ): if self.is_artificial: - return 'pyplusplus does not exports compiler generated constructors' + return 'Py++ does not exports compiler generated constructors' return '' Modified: pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2006-08-14 12:47:13 UTC (rev 401) @@ -190,10 +190,10 @@ def _exportable_impl( self ): if not self.name: - return 'pyplusplus can not expose unnamed classes.' + return 'Py++ can not expose unnamed classes.' #it is possible to do so, but not for unnamed classes defined under namespace. if isinstance( self.parent, declarations.namespace_t ): return '' if not self in self.parent.public_members: - return 'pyplusplus can not expose private class.' + return 'Py++ can not expose private class.' return '' Modified: pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py 2006-08-14 12:47:13 UTC (rev 401) @@ -97,9 +97,9 @@ def get_exportable( self ): if self._exportable is None: if self.name.startswith( '__' ): - self._exportable_reason = 'pyplusplus, by default, does not expose internal compilers declarations. Names of those declarations usually start with "__".' + self._exportable_reason = 'Py++, by default, does not expose internal compilers declarations. Names of those declarations usually start with "__".' elif self.location and self.location.file_name == "<internal>": - self._exportable_reason = 'pyplusplus, by default, does not expose internal declarations (those that gccxml say belong to "<internal>" header).' + self._exportable_reason = 'Py++, by default, does not expose internal declarations (those that gccxml say belong to "<internal>" header).' else: self._exportable_reason = self._exportable_impl( ) self._exportable = not bool( self._exportable_reason ) Modified: pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py 2006-08-14 12:47:13 UTC (rev 401) @@ -14,11 +14,11 @@ self._setter_call_policies = None __call_policies_doc__ = \ - """There are usecase, when exporting member variable forces pyplusplus to + """There are usecase, when exporting member variable forces Py++ to create accessors functions. Sometime, those functions requires call policies. To be more specific: when you export member variable that has reference or pointer type, you need to tell boost.python library how to manage object - life-time. In all cases, pyplusplus will give reasonable default value. I am + life-time. In all cases, Py++ will give reasonable default value. I am sure, that there are use cases, when you need to change it. You should use this property to change it. """ @@ -41,16 +41,16 @@ #if not isinstance( self.parent, declarations.class_t ): # return '' if not self.name: - return "pyplusplus can not expose unnamed variables" + return "Py++ can not expose unnamed variables" if self.bits == 0 and self.name == "": - return "pyplusplus can not expose alignement bit." + return "Py++ can not expose alignement bit." type_ = declarations.remove_alias( self.type ) type_ = declarations.remove_const( type_ ) if declarations.is_pointer( type_ ): if self.type_qualifiers.has_static: - return "pyplusplus can not expose static pointer member variables. This could be changed in future." + return "Py++ can not expose static pointer member variables. This could be changed in future." if declarations.is_fundamental( type_.base ): - return "pyplusplus can not expose pointer to fundamental member variables. This could be changed in future." + return "Py++ can not expose pointer to fundamental member variables. This could be changed in future." units = declarations.decompose_type( type_ ) ptr2functions = filter( lambda unit: isinstance( unit, declarations.calldef_type_t ) @@ -62,6 +62,6 @@ if declarations.class_traits.is_my_case( type_ ): cls = declarations.class_traits.get_declaration( type_ ) if not cls.name: - return "pyplusplus can not expose variables of with unnamed type." + return "Py++ can not expose variables of with unnamed type." return '' \ No newline at end of file Modified: pyplusplus_dev/pyplusplus/file_writers/writer.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/writer.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/file_writers/writer.py 2006-08-14 12:47:13 UTC (rev 401) @@ -65,7 +65,7 @@ writer_t.logger.debug( 'write code to file "%s" - started' % fpath ) start_time = time.clock() fcontent_new = [] - fcontent_new.append( '// This file has been generated by pyplusplus.' ) + fcontent_new.append( '// This file has been generated by Py++.' ) fcontent_new.append( os.linesep * 2 ) fcontent_new.append( content ) fcontent_new.append( os.linesep ) #keep gcc happy Modified: pyplusplus_dev/pyplusplus/gui/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/gui/__init__.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/gui/__init__.py 2006-08-14 12:47:13 UTC (rev 401) @@ -4,7 +4,7 @@ # http://www.boost.org/LICENSE_1_0.txt) """ -This package provide simple GUI interface. If you have installed pyplusplus and +This package provide simple GUI interface. If you have installed Py++ and pygccxml you can invoke GUI from shell using pyplusplus_gui command on Linux. On Windows you can run pyplusplus_gui.pyw file. """ Modified: pyplusplus_dev/pyplusplus/gui/ui.py =================================================================== --- pyplusplus_dev/pyplusplus/gui/ui.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/gui/ui.py 2006-08-14 12:47:13 UTC (rev 401) @@ -128,7 +128,7 @@ map( self._include_paths.delete, selected ) def _add_define( self ): - symbol = tkSimpleDialog.askstring(title='pyplusplus - code generator demo' + symbol = tkSimpleDialog.askstring(title='Py++ - code generator demo' , prompt="Define symbol ( example 'max(a,b)=a<b?b:a' ):") if symbol: self._defines.insert( Tkinter.END, symbol ) @@ -195,7 +195,7 @@ temp.grid( row=0, columnspan=3, sticky=Tkinter.NW + Tkinter.E ) temp = Tkinter.Button( self - , text="generate pyplusplus code" + , text="generate Py++ code" , command=on_generate_pyplusplus ) temp.grid( row=1, sticky=Tkinter.NW + Tkinter.E) @@ -270,7 +270,7 @@ top.rowconfigure( 0, weight=1 ) top.columnconfigure( 0, weight=1 ) - self.master.title('pyplusplus - code generator demo') + self.master.title('Py++ - code generator demo') self._header_file_configurator = header_file_ui_t( self ) self._header_file_configurator.grid( row=0, column=0, sticky=Tkinter.NW, padx=2, pady=2) Modified: pyplusplus_dev/pyplusplus/module_builder/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/__init__.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/module_builder/__init__.py 2006-08-14 12:47:13 UTC (rev 401) @@ -4,11 +4,11 @@ # http://www.boost.org/LICENSE_1_0.txt) """ -This package provides users with simple and convinient interface to pyplusplus +This package provides users with simple and convinient interface to Py++ functionality. L{module_builder_t} class is the main class. Please read it's documentation first. -Also take a look on tutorials. You can find them on pyplusplus +Also take a look on tutorials. You can find them on Py++ U{web site<http://www.language-binding.net>} """ Modified: pyplusplus_dev/pyplusplus/module_builder/builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/builder.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/module_builder/builder.py 2006-08-14 12:47:13 UTC (rev 401) @@ -18,8 +18,8 @@ class module_builder_t(object): """ - This class provides users with simple and intuitive interface to pyplusplus - and/or pygccxml functionality. If this is your first attempt to use pyplusplus + This class provides users with simple and intuitive interface to Py++ + and/or pygccxml functionality. If this is your first attempt to use Py++ consider to read tutorials. You can find them on U{web site<http://www.language-binding.net>}. """ Modified: pyplusplus_dev/pyplusplus/module_creator/class_organizer.py =================================================================== --- pyplusplus_dev/pyplusplus/module_creator/class_organizer.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/module_creator/class_organizer.py 2006-08-14 12:47:13 UTC (rev 401) @@ -88,7 +88,7 @@ else: pass #there is usecase where base class defined within some class - #but his derives defined out of the class. right now pyplusplus + #but his derives defined out of the class. right now Py++ #doesn't supports this situation. self.__colors[base] = COLOR.BLACK Modified: pyplusplus_dev/pyplusplus/module_creator/creator.py =================================================================== --- pyplusplus_dev/pyplusplus/module_creator/creator.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/module_creator/creator.py 2006-08-14 12:47:13 UTC (rev 401) @@ -44,7 +44,7 @@ INDEXING_SUITE_2_MAIN_HEADER = "boost/python/suite/indexing/container_suite.hpp" -DO_NOT_REPORT_MSGS = [ "pyplusplus does not exports compiler generated constructors" ] +DO_NOT_REPORT_MSGS = [ "Py++ does not exports compiler generated constructors" ] class creator_t( declarations.decl_visitor_t ): """Creating code creators. @@ -221,7 +221,7 @@ vfunction_selector = lambda member: isinstance( member, declarations.member_function_t ) \ and member.virtuality == VIRTUALITY_TYPES.PURE_VIRTUAL members.extend( filter( vfunction_selector, class_decl.private_members ) ) - #now lets filter out none public operators: pyplusplus does not support them right now + #now lets filter out none public operators: Py++ does not support them right now members = filter( lambda decl: not isinstance( decl, declarations.member_operator_t ) or decl.access_type == ACCESS_TYPES.PUBLIC , members ) Modified: pyplusplus_dev/pyplusplus/module_creator/types_database.py =================================================================== --- pyplusplus_dev/pyplusplus/module_creator/types_database.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/pyplusplus/module_creator/types_database.py 2006-08-14 12:47:13 UTC (rev 401) @@ -75,7 +75,7 @@ except RuntimeError: msg = "%s;%s" \ % ( str(container_cls) - , "pyplusplus can not find out container value_type( mapped_type )." + , "Py++ can not find out container value_type( mapped_type )." "The container class is template instantiation declaration and not definition." "This container class will be exported, but there is a posiblity, that generated code will not compile." "The solution to the problem is to create a variable of the class." ) Modified: pyplusplus_dev/setup.py =================================================================== --- pyplusplus_dev/setup.py 2006-08-14 10:10:54 UTC (rev 400) +++ pyplusplus_dev/setup.py 2006-08-14 12:47:13 UTC (rev 401) @@ -50,9 +50,9 @@ print "Generating epydoc files..." - docindex = build_doc_index(['pyplusplus', 'pygccxml']) + docindex = build_doc_index(['Py++', 'pygccxml']) html_writer = HTMLWriter( docindex - , prj_name='pyplusplus' + , prj_name='Py++' , prj_url='http://www.language-binding.net' , include_sourcecode=False #This will decrease the size of generated documentation , show_private=False @@ -86,9 +86,9 @@ generate_doc() -setup( name = "pyplusplus", +setup( name = "Py++", version = "0.8.1", - description="pyplusplus is a framework of components for creating C++ code generator for boost.python library", + description="Py++ is a framework of components for creating C++ code generator for Boost.Python library", author="Roman Yakovenko", author_email="rom...@gm...", url='http://www.language-binding.net/pyplusplus/pyplusplus.html', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-14 10:11:45
|
Revision: 400 Author: roman_yakovenko Date: 2006-08-14 03:10:54 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=400&view=rev Log Message: ----------- renaming pyplusplus to Py++ Modified Paths: -------------- index.rest pygccxml_dev/docs/download.rest pygccxml_dev/docs/history/history.rest pygccxml_dev/docs/pygccxml.rest pygccxml_dev/docs/query_interface.rest pyplusplus_dev/docs/comparisons/compare_to.rest pyplusplus_dev/docs/comparisons/pyste.rest pyplusplus_dev/docs/definition.rest pyplusplus_dev/docs/documentation/architecture.rest pyplusplus_dev/docs/documentation/best_practices.rest pyplusplus_dev/docs/documentation/containers.rest pyplusplus_dev/docs/documentation/doc_string.rest pyplusplus_dev/docs/documentation/feedback.rest pyplusplus_dev/docs/documentation/hints.rest pyplusplus_dev/docs/documentation/how_to.rest pyplusplus_dev/docs/documentation/index.rest pyplusplus_dev/docs/documentation/inserting_code.rest pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest pyplusplus_dev/docs/documentation/tutorials/tutorials.rest pyplusplus_dev/docs/download.rest pyplusplus_dev/docs/examples/boost/boost.rest pyplusplus_dev/docs/examples/easybmp/easybmp.rest pyplusplus_dev/docs/examples/examples.rest pyplusplus_dev/docs/history/history.rest pyplusplus_dev/docs/links.rest pyplusplus_dev/docs/osdc2006/presentation-talk.rest pyplusplus_dev/docs/peps/call_wrapper_policies.rest pyplusplus_dev/docs/peps/indexing_suite.rest pyplusplus_dev/docs/peps/peps_index.rest pyplusplus_dev/docs/pyplusplus.rest pyplusplus_dev/docs/quotes.rest pyplusplus_dev/docs/www_configuration.py Modified: index.rest =================================================================== --- index.rest 2006-08-14 07:05:16 UTC (rev 399) +++ index.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -16,17 +16,17 @@ .. __: `pygccxml`_ ------------------- -pyplusplus package ------------------- +------------ +Py++ package +------------ "I love deadlines. I love the whooshing noise they make as they go by." -- Douglas Adams -Meet your deadlines with powerful code generator engine - `pyplusplus`_. +Meet your deadlines with powerful code generator engine - `Py++`_. -`pyplusplus`_ package and `Boost.Python`_ library provide a complete solution for +`Py++`_ package and `Boost.Python`_ library provide a complete solution for interfacing Python and C++. --------------- @@ -73,7 +73,7 @@ .. _`Boost`: http://boost.org/ .. _`Python`: http://www.python.org .. _`pygccxml`: ./pygccxml/pygccxml.html -.. _`pyplusplus`: ./pyplusplus/pyplusplus.html +.. _`Py++`: ./pyplusplus/pyplusplus.html .. _`pydsc`: ./pydsc/pydsc.html .. _`EasyBMP`: http://easybmp.sourceforge.net/ Modified: pygccxml_dev/docs/download.rest =================================================================== --- pygccxml_dev/docs/download.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pygccxml_dev/docs/download.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -12,7 +12,7 @@ can: 1) get access to source code -2) get access to latest release version of pyplusplus +2) get access to latest release version of `pygccxml`_ ----------------- Modified: pygccxml_dev/docs/history/history.rest =================================================================== --- pygccxml_dev/docs/history/history.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pygccxml_dev/docs/history/history.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -1,6 +1,6 @@ -============================== -pyplusplus development history -============================== +============================ +pygccxml development history +============================ .. contents:: Table of contents Modified: pygccxml_dev/docs/pygccxml.rest =================================================================== --- pygccxml_dev/docs/pygccxml.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pygccxml_dev/docs/pygccxml.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -24,7 +24,7 @@ * parse C++ source code * build a code generator - + `pyplusplus`_ is heavily based on `pygccxml`_ + + `Py++`_ is heavily based on `pygccxml`_ + generate `WSDL`_ file from sources + ... @@ -126,7 +126,7 @@ strategy. .. _`WSDL`: http://www.w3.org/TR/wsdl -.. _`pyplusplus`: ./../pyplusplus/pyplusplus.html +.. _`Py++`: ./../pyplusplus/pyplusplus.html .. _`pygccxml`: ./pygccxml.html .. _`SourceForge`: http://sourceforge.net/index.php .. _`Docutils`: http://docutils.sourceforge.net Modified: pygccxml_dev/docs/query_interface.rest =================================================================== --- pygccxml_dev/docs/query_interface.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pygccxml_dev/docs/query_interface.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -175,7 +175,7 @@ Return value of ``member_functions`` is not Python list or set, but instance of ``mdecl_wrapper_t`` class. This class allows you to work on all selected -objects at once. I will give an example from another project - `pyplusplus`_. +objects at once. I will give an example from another project - `Py++`_. In order to help `Boost.Python`_ to manage objects life time, all functions should have `call policies`_. For example: :: @@ -200,7 +200,7 @@ clone.call_policies = return_value_policy( manage_new_object ) -Another example, from `pyplusplus`_ project. Sometimes it is desirable to +Another example, from `Py++`_ project. Sometimes it is desirable to exclude declaration, from being exported to Python. Next code will exclude ``clone`` member function from being exported: @@ -270,7 +270,7 @@ .. _`call policies`: http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies .. _`Call policies`: http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies .. _`pygccxml`: ./pygccxml.html -.. _`pyplusplus`: ./../pyplusplus/pyplusplus.html +.. _`Py++`: ./../pyplusplus/pyplusplus.html .. _`SourceForge`: http://sourceforge.net/index.php .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/comparisons/compare_to.rest =================================================================== --- pyplusplus_dev/docs/comparisons/compare_to.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/comparisons/compare_to.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -1,6 +1,6 @@ -========================= -Compare pyplusplus to ... -========================= +=================== +Compare Py++ to ... +=================== .. contents:: Table of contents @@ -9,7 +9,7 @@ ----- `Pyste`_ is the Boost.Python code generator, that is not under active development -any more. Nevertheless, users request to compare `pyplusplus`_ and `Pyste`_. You +any more. Nevertheless, users request to compare `Py++`_ and `Pyste`_. You can read `here`_ the comparison. .. _`here` : ./Pyste.html @@ -18,7 +18,7 @@ SWIG & SIP ---------- -The document, that compares SIP, SWIG and `pyplusplus`_ is under construction. +The document, that compares SIP, SWIG and `Py++`_ is under construction. May be you are editing it right now, by evaluating these tools :-). I did not use SWIG and SIP, so I can not provide you with fair comparison. I will let the open source project(s) "to talk": @@ -26,7 +26,7 @@ * `Python-OGRE`_: The impression of Lakin Wecker, after spending 30 hours working working with - `pyplusplus`_: http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=1478&sid=4d77585146aabbc54f4b31ec50874d86 + `Py++`_: http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=1478&sid=4d77585146aabbc54f4b31ec50874d86 .. _`Python-OGRE` : http://lakin.weckers.net/index_ogre_python.html @@ -42,7 +42,7 @@ -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`Pyste`: http://www.boost.org/libs/python/doc/index.html Modified: pyplusplus_dev/docs/comparisons/pyste.rest =================================================================== --- pyplusplus_dev/docs/comparisons/pyste.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/comparisons/pyste.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -1,11 +1,11 @@ -============================== -Pyste & pyplusplus comparison -============================== +======================== +Pyste & Py++ comparison +======================== .. contents:: Table of contents ---------------------- -What is `pyplusplus`_? +What is `Py++`_? ---------------------- .. include:: ../definition.rest @@ -25,7 +25,7 @@ -------- If you are reading this document, I can assume that you know what `Boost.Python`_, -`Pyste`_ and `pyplusplus`_ are. This document compares `Pyste`_ and `pyplusplus`_. +`Pyste`_ and `Py++`_ are. This document compares `Pyste`_ and `Py++`_. I am going to compare: * user interface @@ -55,7 +55,7 @@ I tried to fix `Pyste`_. At first, I developed `pygccxml`_ and tried to replace relevant `Pyste`_ functionality. I did not like the result. After this, I dropped -the idea to fix `Pyste`_ and decided to develop new code generator - `pyplusplus`_. +the idea to fix `Pyste`_ and decided to develop new code generator - `Py++`_. Later you will find few points, that explains, why I decided not to fix `Pyste`_. Have a nice reading. @@ -98,17 +98,17 @@ I have more examples, but I think you've got the idea. -pyplusplus ----------- +Py++ +---- -`pyplusplus`_ has 2 user interfaces: +`Py++`_ has 2 user interfaces: 1. GUI - small and simple graphic user interface, that does not request from - user any knowledge about `Boost.Python`_ or `pyplusplus`_. You can see + user any knowledge about `Boost.Python`_ or `Py++`_. You can see its `screenshot`_. 2. API - object-oriented framework, that helps you to create code generator, - that suites your needs. `pyplusplus`_ framework consists 3 packages: + that suites your needs. `Py++`_ framework consists 3 packages: 1. Code creators package. The only responsibility of classes in this package is to create code. Those classes do not care where code is @@ -121,7 +121,7 @@ 3. File writers package. This package contains classes that write generated code to file(s). -The good news: it is very easy to evaluate `pyplusplus`_, using GUI. The bad +The good news: it is very easy to evaluate `Py++`_, using GUI. The bad news is that you should learn an other set of API's in order to complete your task. It is not as awful as it sounds, but still there is some learning curve. @@ -152,12 +152,12 @@ 2. to control the order of written code -pyplusplus ----------- +Py++ +---- One of the biggest weaknesses of `Pyste`_ is a lack of good `GCC-XML`_ front-end and this fact cause `Pyste`_ to generate not optimal code. I will prove this -later. In order to avoid such weakness, before I have created `pyplusplus`_, +later. In order to avoid such weakness, before I have created `Py++`_, I created `pygccxml`_. `pygccxml`_ is a stand alone project, that provides few things: @@ -172,14 +172,14 @@ + every file will be parsed alone, after this, duplicated declarations and types will be removed -`pygccxml`_ contributes in few ways to `pyplusplus`_: +`pygccxml`_ contributes in few ways to `Py++`_: - + `pyplusplus`_ has nothing to do with code parsing. Theoretically + + `Py++`_ has nothing to do with code parsing. Theoretically an other back-end could be added to `pygccxml`_ without changing even one - line of code within `pyplusplus`_. + line of code within `Py++`_. + `pygccxml`_ has type traits. A lot of type traits algorithms from - `boost.type_traits`_ library has been implemented. `pyplusplus`_ makes + `boost.type_traits`_ library has been implemented. `Py++`_ makes an extensive use of them: * identify "call policies" algorithm @@ -195,7 +195,7 @@ do_smth(expensive_to_copy* x, const expensive_to_copy& y){ //Pyste generates next code //call_method< void >(self, "do_smth", x, y); - //pyplusplus generates next code + //Py++ generates next code *this->get_override("do_smth")( boost::python::ptr(x), boost::ref(y) ); //------------------------------^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^ } @@ -232,7 +232,7 @@ what is going on, in "ClassExporter.py" file. Class *ClassExporter* knows everything about internal exporters, more over *ClassExporter* is responsible to export all its base classes before it exports itself. This is just wrong. -`pyplusplus`_ implements better solution. `pyplusplus`_ has code creators class +`Py++`_ implements better solution. `Py++`_ has code creators class hierarchy and factory, that creates those code creators based on given declarations. The questions like: @@ -246,7 +246,7 @@ solved by the factory. The only thing that left to code creators is to create code. By the way, it is not an easy task to fix this specific problem in `Pyste`_. -Serious re-factoring should be done. `pyplusplus`_ defines *compound_t* code +Serious re-factoring should be done. `Py++`_ defines *compound_t* code creator. *module_t*, *module_body_t*, *class_t* - are typical examples of compound code creators. They do know few code creators, but that is all. @@ -257,7 +257,7 @@ protocol and may be to modify code unit. Try to add *Exporter* that exposes get\\set functions as property. It is not an easy task. An other problem, I see here, is that code unit is some kind of *Exporter*. Code unit also creates code. -I did not fill good with this design. So I decided, that in `pyplusplus`_ code +I did not fill good with this design. So I decided, that in `Py++`_ code should be created only by code creators. This decision simplifies a lot of things: @@ -277,29 +277,29 @@ ------------ Dependencies ------------ -Both `Pyste`_ and `pyplusplus`_ introduce one external dependency. In order to -parse XML `Pyste`_ uses `elementtree`_. On the other side `pyplusplus`_ +Both `Pyste`_ and `Py++`_ introduce one external dependency. In order to +parse XML `Pyste`_ uses `elementtree`_. On the other side `Py++`_ depends on `pygccxml`_ project. ------------- Features list ------------- -`pyplusplus`_ supports almost all features `Pyste`_ implements. `pyplusplus`_, +`Py++`_ supports almost all features `Pyste`_ implements. `Py++`_, version 0.8.0, does not implements next functionality, implemented by `Pyste`_: * *pow* operator * good documentation -Here you can find the complete features list of `pyplusplus`_. +Here you can find the complete features list of `Py++`_. -Features unique to `pyplusplus`_: +Features unique to `Py++`_: - * `pyplusplus`_ exposes protected member functions + * `Py++`_ exposes protected member functions - * `pyplusplus`_, in most cases, will automatically detect class held type + * `Py++`_, in most cases, will automatically detect class held type - * `pyplusplus`_ creates implicit conversion code for: + * `Py++`_ creates implicit conversion code for: + casting constructors @@ -313,13 +313,13 @@ * operators defined in base class could be redefined/exposed in derived class - * `pyplusplus`_ exposes bit fields member variables + * `Py++`_ exposes bit fields member variables Nice features list ------------------ -Both `Pyste`_ and `pyplusplus`_ generate working code. As we already saw in some -cases `pyplusplus`_ do better job. `pyplusplus`_ allows next customization on +Both `Pyste`_ and `Py++`_ generate working code. As we already saw in some +cases `Py++`_ do better job. `Py++`_ allows next customization on generated code: * To define std and user directories. *include_t* code creator will take @@ -331,7 +331,7 @@ namespace dt = boost::date_time; All code, that is generated after this statement, will use ``dt`` instead of - ``boost::date_time``. This allows `pyplusplus`_ to create user friendly code. + ``boost::date_time``. This allows `Py++`_ to create user friendly code. * Classes and functions support 2 modes of code generation. Example: :: @@ -369,13 +369,13 @@ 2. If in future a developer decide to create overload to some function, this code will continue to compile. - * `pyplusplus`_ has small nice future - "license". User can specify the + * `Py++`_ has small nice future - "license". User can specify the license and it will appear in every generated file. - * `pyplusplus`_ allows user to define custom call policies resolver. See + * `Py++`_ allows user to define custom call policies resolver. See boost.date_time example - * `pyplusplus`_ allows user to create custom code creators. See + * `Py++`_ allows user to create custom code creators. See "custom_code_creator" example. * real world examples: @@ -390,9 +390,9 @@ Conclusion ---------- -If I were you I would choose `pyplusplus`_ to create bindings for your project. -For very small projects or for educational reasons you may use `pyplusplus`_.GUI. -For big projects, you need flexibility and power of `pyplusplus`_. +If I were you I would choose `Py++`_ to create bindings for your project. +For very small projects or for educational reasons you may use `Py++`_.GUI. +For big projects, you need flexibility and power of `Py++`_. ---- P.S. @@ -401,22 +401,22 @@ This comparison was a little unfair. First of all `Pyste`_ is no more under active development\\support. Second, `Pyste`_ has been written 2 years ago and had different goal. Next definitions will help you to understand the main -difference between `Pyste`_ and `pyplusplus`_. +difference between `Pyste`_ and `Py++`_. `Pyste`_ `Pyste`_ is `Boost.Python`_ code generator. - `pyplusplus`_ + `Py++`_ .. include:: ../definition.rest -`Pyste`_ and `pyplusplus`_ have been created to handle different tasks, hence +`Pyste`_ and `Py++`_ have been created to handle different tasks, hence the difference in design, user interface and complexity. Bruno da Silva de Oliveira, the `Pyste`_ author, understands the problems, I raised here. He -thought about them, long before I created `pyplusplus`_. But unfortunately, lack +thought about them, long before I created `Py++`_. But unfortunately, lack of time and motivation prevents him to work on `Pyste`_. .. _`screenshot` : ./../tutorials/pyplusplus_demo.png -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html .. _`Pyste`: http://www.boost.org/libs/python/doc/index.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html Modified: pyplusplus_dev/docs/definition.rest =================================================================== --- pyplusplus_dev/docs/definition.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/definition.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -1,4 +1,4 @@ -`pyplusplus`_ is an object-oriented framework for creating a code generator for +`Py++`_ is an object-oriented framework for creating a code generator for `Boost.Python`_ library. .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html \ No newline at end of file Modified: pyplusplus_dev/docs/documentation/architecture.rest =================================================================== --- pyplusplus_dev/docs/documentation/architecture.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/documentation/architecture.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -8,7 +8,7 @@ Introduction ------------ -This document will describe an architecture behind `pyplusplus`_. +This document will describe an architecture behind `Py++`_. --- C++ @@ -31,7 +31,7 @@ * C++ source files parsing and caching functionality -`pyplusplus`_ uses those services to: +`Py++`_ uses those services to: * extract declarations from source files and to provide powerful query interface @@ -46,17 +46,17 @@ * ... -pyplusplus & pygccxml integration ---------------------------------- +Py++ & pygccxml integration +--------------------------- -`pyplusplus`_ uses different approaches to expose these services to the user. +`Py++`_ uses different approaches to expose these services to the user. Parsing integration ------------------- -`pyplusplus`_ provides it's own "API" to configure and run `pygccxml`_ parsing +`Py++`_ provides it's own "API" to configure and run `pygccxml`_ parsing services. The "API" I am talking about, is arguments to ``module_builder.__init__`` method. The method takes all arguments, needed to envoke parsing services. It -has been done this way to simplify the usage of `pyplusplus`_. +has been done this way to simplify the usage of `Py++`_. Declarations tree integration @@ -98,7 +98,7 @@ What you see here, is a common pattern, that will appear in all projects, that -use `pyplusplus`_: +use `Py++`_: * find the declaration(s) @@ -108,7 +108,7 @@ good, it makes a lot of sence to configure the code generation engine, using the declarations tree. Now, the desired solution is clear: we should use declarations tree to configure the engine. So, let me to re-formulate the -question: how does `pyplusplus`_ add missinig functionality to +question: how does `Py++`_ add missinig functionality to ``pygccxml.declarations`` classes? There were few possible solutions to the problem. The next one was implemented: @@ -157,7 +157,7 @@ * How it should be written to files? - Remember, `pyplusplus`_ is targeting big projects. It can not generate all code + Remember, `Py++`_ is targeting big projects. It can not generate all code in one file - this will not work, not at all. Code creators and file writers provides solution to this problem. @@ -204,7 +204,7 @@ As you can see, there are primary 2 kinds of ``code creator``'s: declaration based and others. Declaration based creator generates code, that is needed to export the declaration. There a lot of use cases, where in order to export a -declaration, `pyplusplus`_ builds more then one ``code creator``. For example: +declaration, `Py++`_ builds more then one ``code creator``. For example: in order to export virtual function 2 ``code creator``'s are built: ( I will reuse example from `Boost.Python`_ `tutorials`__.) @@ -287,11 +287,11 @@ variables. Thus it knows that class ``X`` is used with ``boost::shared_ptr``, so it will set ``class_<X>`` ``HeldType`` to be ``boost::shared_ptr`` or will register its usage. Another interesting example is std containers. You don't have -to say to `pyplusplus`_ to export them, it will do it by itself. You may ask +to say to `Py++`_ to export them, it will do it by itself. You may ask why this detail is so interesting? Because the user does not have to specify all -set of declarations he wants to export! Because, in near future, `pyplusplus`_ +set of declarations he wants to export! Because, in near future, `Py++`_ will analize declarations dependency graph of exported declarations. If some -declaration should be exported and it is not, then `pyplusplus`_ will warn the +declaration should be exported and it is not, then `Py++`_ will warn the user. @@ -317,7 +317,7 @@ -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org Modified: pyplusplus_dev/docs/documentation/best_practices.rest =================================================================== --- pyplusplus_dev/docs/documentation/best_practices.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/documentation/best_practices.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -8,9 +8,9 @@ Introduction ------------ -`pyplusplus`_ has reach interface and a lot of functionality. Sometimes reach +`Py++`_ has reach interface and a lot of functionality. Sometimes reach interface helps, but sometimes it can confuse. This document will describe how -effectivly to use `pyplusplus`_. +effectivly to use `Py++`_. ------------ Big projects @@ -20,9 +20,9 @@ ---------- First of all, let me to define "big project". "Big project" is a project with -few handred of header files. `pyplusplus`_ was born to create `Python`_ bindings +few handred of header files. `Py++`_ was born to create `Python`_ bindings for such projects. If you take a look `here`__ you will find few such projects, -that use `pyplusplus`_. +that use `Py++`_. .. __ : ./../../pygccxml/quotes.html @@ -49,7 +49,7 @@ * Single header file, will also improve performance compiling the generated bindings. - When `pyplusplus`_ generated the bindings, you have a lot of .cpp files to + When `Py++`_ generated the bindings, you have a lot of .cpp files to compile. The project you are working on is big. I am sure it takes a lot of time to compile projects that depend on it. Generated code also depend on it, more over this code contains a lot of template isnstantiations. So it could @@ -71,12 +71,12 @@ ``precompiled_header`` argument could be ``None`` or string, that contains name of precompiled header file, that will be created in the directory. - `pyplusplus`_ will add to it header files from `Boost.Python`_ library and + `Py++`_ will add to it header files from `Boost.Python`_ library and your header files. What is ``huge_classes`` argument for? ``huge_classes`` could be ``None`` or list of references to class declarations. It is there to provide a solution to - `this error`_. ``pyplusplus`` will automaticly split generated code for the + `this error`_. `Py++`_ will automaticly split generated code for the huge classes to few files: :: @@ -92,7 +92,7 @@ -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org Modified: pyplusplus_dev/docs/documentation/containers.rest =================================================================== --- pyplusplus_dev/docs/documentation/containers.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/documentation/containers.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -52,10 +52,10 @@ .. _`documentation` : ./indexing_suite_v2.html .. _`post` : http://mail.python.org/pipermail/c++-sig/2003-October/005802.html ------------------------------- -pyplusplus and indexing suites ------------------------------- -`pyplusplus`_ implements support for both indexing suites. More over, you can +------------------------ +Py++ and indexing suites +------------------------ +`Py++`_ implements support for both indexing suites. More over, you can freely mix indexing suites. For example you can expose ``std::vector<int>`` using `Boost.Python`_ built-in indexing suite and ``std::map< int, std::string>`` using Raoul Gough's indexing suite. @@ -64,9 +64,9 @@ How does it work? ----------------- -In both cases, `pyplusplus`_ provides almost "hands free" solution. `pyplusplus`_ +In both cases, `Py++`_ provides almost "hands free" solution. `Py++`_ keeps track of all exported functions and variables, and if it sees that there is -a usage of stl container, it exports the container. In both cases, `pyplusplus`_ +a usage of stl container, it exports the container. In both cases, `Py++`_ analizes the container ``value_type`` ( or in case of mapping container ``mapped_type`` ), in order to set reasonable defaults, when it generates the code. @@ -74,7 +74,7 @@ Indexing suites API ------------------- -By default, `pyplusplus`_ works with built-in indexing suite. If you want to use +By default, `Py++`_ works with built-in indexing suite. If you want to use next version of indexing suite, you should tell this to the ``module_builder_t.__init__`` method: :: @@ -86,7 +86,7 @@ of ``indexing_suite1_t`` or ``indexing_suite2_t`` class. -How does `pyplusplus`_ know, that a class represents stl container instantiation? +How does `Py++`_ know, that a class represents stl container instantiation? Well, it uses ``pygccxml.declarations.container_traits`` to find out this. ``pygccxml.declarations.container_traits`` class, provides all functionality needed to identify container and to find out its ``value_type`` @@ -96,7 +96,7 @@ Built-in indexing suite API --------------------------- -`pyplusplus`_ defines ``indexing_suite1_t`` class. This class allows configure +`Py++`_ defines ``indexing_suite1_t`` class. This class allows configure any detail of generated code: * ``no_proxy`` - a boolean, if ``value_type`` is one of the next types @@ -136,19 +136,19 @@ }; -`pyplusplus`_ declarations tree will contains ``item``, ``my_data``, +`Py++`_ declarations tree will contains ``item``, ``my_data``, ``vector<item>`` and ``map<string,item>`` class declarations. If ``value_type`` does not support "equal" or "less than" functionality, sort and search functionality could not be exported. -`pyplusplus`_ class declaration has two properties: ``equality_comparable`` and +`Py++`_ class declaration has two properties: ``equality_comparable`` and ``less_than_comparable``. The value of those properties is calculated on first -invocation. If `pyplusplus`_ can find ``operator==``, that works on ``value_type``, +invocation. If `Py++`_ can find ``operator==``, that works on ``value_type``, then, ``equality_comparable`` property value will be set to ``True``, otherwise to ``False``. Same process is applied on ``less_than_comparable`` property. -In our case, `pyplusplus`_ will set both properties to ``False``, thus sort and +In our case, `Py++`_ will set both properties to ``False``, thus sort and search functionality will not be exported. It is the time to introduce ``indexing_suite2_t`` class: @@ -163,13 +163,13 @@ * ``element_type`` - is a reference to container ``value_type`` or ``mapped_type``. * ``call_policies`` - read/write property, in near future I will add code to - `pyplusplus`_ that will analize container ``value_type`` and will decide about + `Py++`_ that will analize container ``value_type`` and will decide about default call policies. Just an example: for non copy constructable classes ``call_policies`` should be set to ``return_internal_reference``. * ``[disable|enable]_method`` - new indexing suite, allows to configure functionality exported to Python, using simple bitwise operations on predefined - flags. `pyplusplus`_ allows you to specify what methods you want to disable + flags. `Py++`_ allows you to specify what methods you want to disable or enable. ``indexing_suite2_t.METHODS`` containes names of all supported methods. * ``[disable|enable]_methods_group`` - almost same as above, but allows you @@ -184,11 +184,11 @@ explicitly to disable method or mothods group. 2. The documentation of new indexing suite containes few small mistakes. - I hope, I will have time to fix them. Any way, `pyplusplus`_ generates + I hope, I will have time to fix them. Any way, `Py++`_ generates correct code. -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/doc_string.rest =================================================================== --- pyplusplus_dev/docs/documentation/doc_string.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/documentation/doc_string.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -8,7 +8,7 @@ Introduction ------------ -`pyplusplus`_ provides a convenient way to export documentation from C++ source +`Py++`_ provides a convenient way to export documentation from C++ source files as `Python`_ `documentation string`_ --------------- @@ -23,11 +23,11 @@ my_class.member_function( "do_nothing" ).documentation = \ '"This function does nothing."' -In `pyplusplus`_ every class, that describes C++ declarations has ``documentation`` +In `Py++`_ every class, that describes C++ declarations has ``documentation`` property. This property should contain valid C++ string or ``None``. `Boost.Python`_ not always provides functionality, that exports documentation string. -In those cases, `pyplusplus`_ will not generate documentation string. +In those cases, `Py++`_ will not generate documentation string. Also the previous method is pretty clear, it is not practical. There should be a better way, to complete the task. Lets take a look on @@ -50,10 +50,10 @@ * ``decl.location.line`` - line number. So, you can go to the source file and to extract declaration from it. -`pyplusplus`_ will call ``doc_extractor`` on every exported declaration. +`Py++`_ will call ``doc_extractor`` on every exported declaration. -Now, when I think you understand what functionality `pyplusplus`_ provides. -It is a time to say what functionality is missing. `pyplusplus`_ does not +Now, when I think you understand what functionality `Py++`_ provides. +It is a time to say what functionality is missing. `Py++`_ does not provide any documentation extractor. It is not completely true. You can find document extractor for `doxygen`_ format in ``contrib/doc_extractors`` directory. It has been contributed by Georgiy Dernovoy. @@ -61,7 +61,7 @@ .. _`doxygen` : http://www.stack.nl/~dimitri/doxygen/ .. _`documentation string` : http://docs.python.org/tut/node6.html#SECTION006760000000000000000 -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/feedback.rest =================================================================== --- pyplusplus_dev/docs/documentation/feedback.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/documentation/feedback.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -1,6 +1,6 @@ -===================== -pyplusplus feedback -===================== +============= +Py++ feedback +============= .. contents:: Table of contents @@ -8,7 +8,7 @@ Introduction ------------ -`pyplusplus`_ has been created with few goals in mind: +`Py++`_ has been created with few goals in mind: * to allow users create `Python`_ bindings for large projects using the `Boost.Python`_ library @@ -18,8 +18,8 @@ * to serve as a user's guide for `Boost.Python`_ library -Those goals all have something in common. In order to achive them, `pyplusplus`_ must -give useful feedback to the user. Because `pyplusplus`_ understands the +Those goals all have something in common. In order to achive them, `Py++`_ must +give useful feedback to the user. Because `Py++`_ understands the declarations it exports, it can scan declarations for potential problems, report them and in some cases provide hints about how to resolve the problem. Few examples: @@ -50,21 +50,21 @@ * In order to expose free/member function that takes more than 10 arguments user should define ``BOOST_PYTHON_MAX_ARITY`` macro. -For these problems and many other `pyplusplus`_ gives a nice explanation +For these problems and many other `Py++`_ gives a nice explanation and sometimes a link to the relevant information on the Internet. -I hope, that from now you will find it helpful to read every `pyplusplus`_ message :-). +I hope, that from now you will find it helpful to read every `Py++`_ message :-). ------------- How it works? ------------- In previous paragraph, I described some pretty useful functionality but what should you -do to enable it? - *Nothing!* By default, `pyplusplus`_ only prints the +do to enable it? - *Nothing!* By default, `Py++`_ only prints the important messages to ``stdout``. More over it prints them onle for declarations that are going to be exported. -`pyplusplus`_ uses the python `logging`_ package to write all user messages. By +`Py++`_ uses the python `logging`_ package to write all user messages. By default, messages with ``DEBUG`` level will be skipped, all other messages will be reported. @@ -91,12 +91,12 @@ 2. But what if you want to disable some messages and leave others? This is also possible. - `pyplusplus`_ and `pygccxml`_ do not use a single logger. Almost every internal + `Py++`_ and `pygccxml`_ do not use a single logger. Almost every internal package has its own logger. So you can enable one logger and disable another one. The `pygccxml`_ package defines all loggers in the ``pygccxml.utils`` package. - The `pyplusplus`_ package defines all logers in the ``pyplusplus._logging_`` package. + The `Py++`_ package defines all logers in the ``pyplusplus._logging_`` package. Both packages define a ``loggers`` class. Those classes keep references to different loggers. The ``loggers`` classes look very similar to the next class: @@ -125,7 +125,7 @@ You can use these references in the ``logging`` package to complete your task of adjusting individual loggers. - One more thing, `pyplusplus`_ automatically splits long message, where line + One more thing, `Py++`_ automatically splits long message, where line length defaults to 70 characters. Thus it is very convinient to read them on your screen. If you want to use different tools to monitor those messages, consider to use standard `Formatter`_ class, instead of ``multi_line_formatter_t`` one. @@ -146,7 +146,7 @@ * ``readme( self )`` - This method gives you access to all tips/hints/warnings `pyplusplus`_ has about + This method gives you access to all tips/hints/warnings `Py++`_ has about the declaration. This methods returns a list of strings. If the declaration is not exportable, than first message within the list is an explanation, why it is not exportable. @@ -154,7 +154,7 @@ .. _`Formatter` : http://docs.python.org/lib/node357.html .. _`logging` : http://docs.python.org/lib/module-logging.html -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org Modified: pyplusplus_dev/docs/documentation/hints.rest =================================================================== --- pyplusplus_dev/docs/documentation/hints.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/documentation/hints.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -8,8 +8,8 @@ Class template instantiation alias ---------------------------------- -`pyplusplus`_ has nice feature. If you define ``typedef`` for instantiated class -template, than `pyplusplus`_ will use it as a `Python`_ class name. +`Py++`_ has nice feature. If you define ``typedef`` for instantiated class +template, than `Py++`_ will use it as a `Python`_ class name. For example: :: @@ -26,7 +26,7 @@ ... } -`pyplusplus`_ will use "numbers" as Python class name: +`Py++`_ will use "numbers" as Python class name: :: @@ -38,7 +38,7 @@ This feature will work only in case there is only one such ``typedef``. Using class property ``aliases`` you can get access to all ``typedef``'s of the class. -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/how_to.rest =================================================================== --- pyplusplus_dev/docs/documentation/how_to.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/documentation/how_to.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -41,7 +41,7 @@ Small usage advice. ------------------- -`pyplusplus`_ allows you to define a query that will return you all exception classes: +`Py++`_ allows you to define a query that will return you all exception classes: :: @@ -82,7 +82,7 @@ ; Now, after you know how this problem is solved. I will show how this solution -could be integrated with `pyplusplus`_. +could be integrated with `Py++`_. :: @@ -115,14 +115,14 @@ ------------------------------------------------------------ If you get this error, that the generated file is too big. You will have to split -it to few files. Well, not you but `pyplusplus`_ you will only have to tell that +it to few files. Well, not you but `Py++`_ you will only have to tell that to it. If you are using ``module_builder_t.write_module`` method, consider to switch to ``module_builder_t.split_module``. If you are using ``split_method``, but still generated code for some specific -class could not be compiled because of error, you can ask `pyplusplus`_ to split +class could not be compiled because of error, you can ask `Py++`_ to split class registration code to few cpp files. For more information, please read the documentation. @@ -227,7 +227,7 @@ mb.namespace( 'py_details' ).exclude() -`pyplusplus`_ allows you to extract declarations from string, that contains +`Py++`_ allows you to extract declarations from string, that contains valid C++ code. It creates temporal header file and compiles it. At the end of the compilation process it will remove it. You can read mode about ``create_text_fc`` function `here`__. @@ -246,7 +246,7 @@ -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/index.rest =================================================================== --- pyplusplus_dev/docs/documentation/index.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/documentation/index.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -1,6 +1,6 @@ -======================== -pyplusplus documentation -======================== +================== +Py++ documentation +================== .. contents:: Table of contents @@ -8,13 +8,13 @@ Help needed! ------------ -`pyplusplus`_ documentation is always under active development. It is not an easy +`Py++`_ documentation is always under active development. It is not an easy task to create and maintain it. I will appriciate any help! How can you help? -* Lets face it: today it is not possible to use `pyplusplus`_ without eventually - looking into source code. `pyplusplus`_ uses `Epydoc`_ to generate documentation +* Lets face it: today it is not possible to use `Py++`_ without eventually + looking into source code. `Py++`_ uses `Epydoc`_ to generate documentation from source files. So, if you found some undocumented piece of code and you understand what it does, please write documentation string. @@ -26,7 +26,7 @@ just point me to the place. .. _`Epydoc` : http://epydoc.sourceforge.net/ -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/inserting_code.rest =================================================================== --- pyplusplus_dev/docs/documentation/inserting_code.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/documentation/inserting_code.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -8,7 +8,7 @@ Introduction ------------ -`pyplusplus`_ is not a magician! Sometimes there is a need to add code to +`Py++`_ is not a magician! Sometimes there is a need to add code to generated file(s). This document will describe how you can insert your code to almost any place. @@ -71,7 +71,7 @@ ``int`` is immutable type in Python. So you can not expose ``get_size`` member function as is. You need to create a wrapper and expose it. -In the near future ``pyplusplus`` will eliminate the need of creating hand +In the near future `Py++`_ will eliminate the need of creating hand written wrapper for this use case. :: @@ -92,14 +92,14 @@ ... ; -How it could be achieved with `pyplusplus`_? Class declaration, has also two +How it could be achieved with `Py++`_? Class declaration, has also two functions: * ``add_declaration_code( self, code )`` This method will add the code to the declaration section within the module. - If you split your module to few files, `pyplusplus`_ will add this code to the + If you split your module to few files, `Py++`_ will add this code to the cpp file, class registration code will be written in. Attention: there is no defined order between wrapper code and declaration section @@ -143,7 +143,7 @@ window = mb.class_( 'window_t' ) window.add_declaration_code( get_window_size definition ) window.add_registration_code( 'def( "get_size", &::get_window_size )' ) - #pyplusplus will add ';' if needed + #Py++ will add ';' if needed ---------------------------- Insert code to class wrapper @@ -193,7 +193,7 @@ -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org Modified: pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -1,12 +1,12 @@ -==================== -pyplusplus tutorials -==================== +============== +Py++ tutorials +============== .. contents:: Table of contents -------------------- -What is pyplusplus? -------------------- +------------- +What is Py++? +------------- .. include:: ./../../../definition.rest @@ -14,12 +14,12 @@ Preamble -------- -I guess you decided to try `pyplusplus`_ API. Good! Lets start. First of all, +I guess you decided to try `Py++`_ API. Good! Lets start. First of all, please take a look on two files: * `hello_world.hpp`_ - C++ source code, that we want to export to Python -* `generate_code.py`_ - Python code, that uses `pyplusplus`_ to export +* `generate_code.py`_ - Python code, that uses `Py++`_ to export declarations from the source file .. _`hello_world.hpp` : ./hello_world.html @@ -29,7 +29,7 @@ module_builder_t ---------------- -`pyplusplus`_ is built from a few packages, but there is only one package, you +`Py++`_ is built from a few packages, but there is only one package, you should really to be familiar with - ``module_builder``. This package is some kind of facade to low level API. It provides simple and intuitive API. The main class within this package is ``module_builder_t``. The instance of this class will @@ -65,7 +65,7 @@ Declarations customization -------------------------- Not all declarations should be exported! Not every declaration could be exported -without human invocation! As you already saw from example, `pyplusplus`_ provides +without human invocation! As you already saw from example, `Py++`_ provides simple and powerful declarations query interface. By default, only declarations that belongs to files, you have asked to parse, and to files, that lies in the same directories as parsed files, will be exported: @@ -88,7 +88,7 @@ ``include`` methods, on declarations. Basically, this is a second step of code generation process. During this step -you could/should/may change `pyplusplus`_ defaults: +you could/should/may change `Py++`_ defaults: * to rename exposed declarations * to include/exclude declarations @@ -104,7 +104,7 @@ ----------------------------------- Now it is a time to create module code creator. Do you remember, in inroduction -to `pyplusplus`_, I told you that before writing code to disc, `pyplusplus`_ will +to `Py++`_, I told you that before writing code to disc, `Py++`_ will create some kind of `AST`_. Well this is done by calling ``module_builder_t.build_code_creator`` function. Right now, the only important argument to the function is ``module_name``. Self explained, is it? @@ -136,7 +136,7 @@ will be written in. * ``module_builder_t.split_module`` - you should provide directory name. - For big projects it is a must to minimize compilation time. So `pyplusplus`_ + For big projects it is a must to minimize compilation time. So `Py++`_ splits your module source code to different files within the directory. @@ -151,7 +151,7 @@ That's all. I hope you enjoyed. -.. _`pyplusplus` : ./../../../pyplusplus.html +.. _`Py++` : ./../../../pyplusplus.html .. _`pygccxml` : ./../../../../pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`SourceForge`: http://sourceforge.net/index.php Modified: pyplusplus_dev/docs/documentation/tutorials/tutorials.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/tutorials.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/documentation/tutorials/tutorials.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -4,9 +4,9 @@ .. contents:: Table of contents -------------------- -What is pyplusplus? -------------------- +------------- +What is Py++? +------------- .. include:: ./../../definition.rest @@ -14,17 +14,17 @@ Graphical interface ------------------- -`pyplusplus`_ includes a `graphical interface`_. `Graphical interface`_ +`Py++`_ includes a `graphical interface`_. `Graphical interface`_ is invoked with the ``pyplusplus_gui`` command, or with ``pyplusplus_gui.pyw`` from the ``scripts`` subdirectory of the `Python`_ installation directory. My advise to you - start with `graphical interface`_, because: * you don't have to learn new API * few clicks with mouse and you have `Boost.Python`_ code for your file(s) - * it is very easy to evaluate `pyplusplus`_ using it + * it is very easy to evaluate `Py++`_ using it * you can check whether `GCC-XML`_ is able to compile your code or not * you can use it as a guide to `Boost.Python`_ library - * it is able to generate `pyplusplus`_ code for you + * it is able to generate `Py++`_ code for you .. _`graphical interface` : ./pyplusplus_demo.png .. _`Graphical interface` : ./pyplusplus_demo.png @@ -33,7 +33,7 @@ Getting started --------------- -I suppose you decided to do some coding with `pyplusplus`_. `Module builder`_ +I suppose you decided to do some coding with `Py++`_. `Module builder`_ tutorials will help you. .. _`Module builder` : ./module_builder/module_builder.html @@ -48,7 +48,7 @@ to create your own code creator. To be more specific, it exposes ``get*`` and ``set*`` methods as a single property. -.. _`pyplusplus` : ./../../pyplusplus.html +.. _`Py++` : ./../../pyplusplus.html .. _`pygccxml` : ./../....//pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`SourceForge`: http://sourceforge.net/index.php Modified: pyplusplus_dev/docs/download.rest =================================================================== --- pyplusplus_dev/docs/download.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/download.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -1,18 +1,18 @@ -=================== -pyplusplus download -=================== +============= +Py++ download +============= .. contents:: Table of contents -------------------------- -pyplusplus on SourceForge -------------------------- +------------------- +Py++ on SourceForge +------------------- -`pyplusplus`_ project is hosted on SourceForge. Using SourceForge services you +`Py++`_ project is hosted on SourceForge. Using SourceForge services you can: 1) get access to source code -2) get access to latest release version of pyplusplus +2) get access to latest release version of `Py++`_ ----------------- @@ -32,11 +32,11 @@ ------------ In command prompt or shell change current directory to be "pyplusplus-X.Y.Z". -"X.Y.Z" is version of `pyplusplus`_. Type next command: +"X.Y.Z" is version of `Py++`_. Type next command: | ``python setup.py install`` -After this command complete, you should have installed `pyplusplus`_ package. +After this command complete, you should have installed `Py++`_ package. ------------ Dependencies @@ -45,7 +45,7 @@ * `pygccxml`_ -.. _`pyplusplus` : ./pyplusplus.html +.. _`Py++` : ./pyplusplus.html .. _`pygccxml` : ./../pygccxml/pygccxml.html .. Modified: pyplusplus_dev/docs/examples/boost/boost.rest =================================================================== --- pyplusplus_dev/docs/examples/boost/boost.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/examples/boost/boost.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -8,7 +8,7 @@ Introduction -------------- -What is the `pyplusplus`_? +What is the `Py++`_? -------------------------- .. include:: ./../../definition.rest @@ -35,9 +35,9 @@ .. _`TR2` : http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1810.html -I believe that `pyplusplus`_ is ready for hard work. It is quick, stable and -flexible. `pyplusplus`_ is a new tool and in my opinion I should prove its -usefulness. Using `pyplusplus`_, I exposed next libraries to Python: +I believe that `Py++`_ is ready for hard work. It is quick, stable and +flexible. `Py++`_ is a new tool and in my opinion I should prove its +usefulness. Using `Py++`_, I exposed next libraries to Python: * `Boost.Date_Time`_ * `Boost.CRC`_ @@ -59,7 +59,7 @@ and `Boost.Random`_ libraries. I spent different amount of time on each library. It took me one week, to expose -the `Boost.Date_Time`_ library. I added few missing features to `pyplusplus`_, +the `Boost.Date_Time`_ library. I added few missing features to `Py++`_, polished the existing ones. Most of the time I spent translating tests from C++ to `Python`_. It took me 3 days to expose all other libraries. @@ -301,7 +301,7 @@ .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`boost.operators`: http://www.boost.org/ .. _`GCC-XML`: http://www.gccxml.org -.. _`pyplusplus` : ./../../pyplusplus.html +.. _`Py++` : ./../../pyplusplus.html .. Local Variables: Modified: pyplusplus_dev/docs/examples/easybmp/easybmp.rest =================================================================== --- pyplusplus_dev/docs/examples/easybmp/easybmp.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/examples/easybmp/easybmp.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -15,7 +15,7 @@ for easily reading, writing, and modifying Windows bitmap (BMP) image files. In this example I am referring to version 0.70. -What is `pyplusplus`_? +What is `Py++`_? ---------------------- .. include:: ./../../definition.rest @@ -24,10 +24,10 @@ Description ----------- -`pyplusplus`_ has been used to create `Python`_ bindings for `EasyBMP`_ +`Py++`_ has been used to create `Python`_ bindings for `EasyBMP`_ library. Before proceeding with this example, I should say, that I did not work with `EasyBMP`_ at all. I have seen it's announcement on www.freshmeat.org site -and decided to test `pyplusplus`_ with "real world" project. It took me 30 +and decided to test `Py++`_ with "real world" project. It took me 30 minutes to create full working python version of this library. This examples consist few files and directories: @@ -52,12 +52,12 @@ |target.bmp| .. |source.bmp| image:: ./source.bmp - :alt: pyplusplus logo + :alt: Py++ logo :align: middle .. :border: 0 .. |target.bmp| image:: ./target.bmp - :alt: pyplusplus logo + :alt: Py++ logo :align: middle .. :border: 0 @@ -67,7 +67,7 @@ http://sourceforge.net/project/showfiles.php?group_id=118209. -.. _`pyplusplus` : ./../../pyplusplus.html +.. _`Py++` : ./../../pyplusplus.html .. _`environment.py`: http://cvs.sourceforge.net/viewcvs.py/pygccxml/source/pyplusplus/examples/py_easybmp/environment.py?view=markup .. _`sconstruct`: http://cvs.sourceforge.net/viewcvs.py/pygccxml/source/pyplusplus/examples/py_easybmp/sconstruct?view=markup .. _`grayscale.py`: http://cvs.sourceforge.net/viewcvs.py/pygccxml/source/pyplusplus/examples/py_easybmp/grayscale.py?view=markup Modified: pyplusplus_dev/docs/examples/examples.rest =================================================================== --- pyplusplus_dev/docs/examples/examples.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/examples/examples.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -8,7 +8,7 @@ Graphical interface ------------------- -`pyplusplus`_ has nice, small and simple `graphical interface`_. Please, read +`Py++`_ has nice, small and simple `graphical interface`_. Please, read `tutorials`_ for more information. .. _`graphical interface` : ./../tutorials/pyplusplus_demo.png @@ -30,7 +30,7 @@ Boost provides free peer-reviewed portable C++ source libraries. -Using `pyplusplus`_ I created Python bindings for few libraries: +Using `Py++`_ I created Python bindings for few libraries: * `Boost.Date_Time`_ * `Boost.CRC`_ @@ -51,7 +51,7 @@ .. _`GUI`: ./../tutorials/pyplusplus_demo.png .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html -.. _`pyplusplus` : ./../pyplusplus.html +.. _`Py++` : ./../pyplusplus.html .. _`EasyBMP`: http://easybmp.sourceforge.net/ .. Modified: pyplusplus_dev/docs/history/history.rest =================================================================== --- pyplusplus_dev/docs/history/history.rest 2006-08-14 07:05:16 UTC (rev 399) +++ pyplusplus_dev/docs/history/history.rest 2006-08-14 10:10:54 UTC (rev 400) @@ -1,6 +1,6 @@ -============================== -pyplusplus development history -============================== +======================== +Py++ development history +======================== .. contents:: Table of contents @@ -22,10 +22,10 @@ 0.8.1 ----- -1. Georgiy Dernovoy contributed a patch, that allows `pyplusplus`_ GUI to +1. Georgiy Dernovoy contributed a patch, that allows `Py++`_ GUI to save\\load last used header file. -2. `pyplusplus`_ improved a lot functionality related to providing feedback to user: +2. `Py++`_ improved a lot functionality related to providing feedback to user: * every package has its own logger @@ -42,10 +42,10 @@ 5. Generated code for member and free functions was changed. This changed was introduced to fix compilation errors on msvc 7.1 compiler. -6. `pyplusplus`_ generates "stable" code. If header files were not changed, - `pyplusplus`_ will not change any file. +6. `Py++`_ generates "stable" code. If header files were not changed, + `Py++`_ will not change any file. -7. Support for huge classes was added. `pyplusplus`_ is able to split registration +7. Support for huge classes was added. `Py++`_ is able to split registration code for the class to multiple cpp files. 8. User code could be added almost anywhere, without use of low level API. @@ -61,19 +61,19 @@ Version 0.8.0 ------------- -1. `pyplusplus`_ "user guide" functionality has been improved. Now `pyplusplus`_ +1. `Py++`_ "user guide" functionality has been improved. Now `Py++`_ can answer few questions: * why this declaration could not be exported * why this function could not be overriden from Python -2. `pyplusplus`_ can suggest an alias for exported classes. +2. `Py++`_ can suggest an alias for exported classes. 3. Small redesign has been done - now it is much easier to understand and maintain code creators, that creates code for C++ functions. ... [truncated message content] |
From: <rom...@us...> - 2006-08-14 07:06:22
|
Revision: 399 Author: roman_yakovenko Date: 2006-08-14 00:05:16 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=399&view=rev Log Message: ----------- fixing errors\warnings reported by pychecker Modified Paths: -------------- pydsc_dev/pydsc/pydsc.py pydsc_dev/unittests/to_be_tested.py pygccxml_dev/pygccxml/declarations/algorithm.py pygccxml_dev/pygccxml/declarations/cpptypes.py pygccxml_dev/pygccxml/declarations/declaration.py pygccxml_dev/pygccxml/declarations/filtering.py pygccxml_dev/pygccxml/declarations/matcher.py pygccxml_dev/pygccxml/declarations/pattern_parser.py pygccxml_dev/pygccxml/declarations/scopedef.py pygccxml_dev/pygccxml/declarations/type_traits.py pygccxml_dev/pygccxml/parser/declarations_cache.py pygccxml_dev/pygccxml/parser/project_reader.py pygccxml_dev/unittests/autoconfig.py pygccxml_dev/unittests/core_tester.py pygccxml_dev/unittests/declaration_files_tester.py pygccxml_dev/unittests/file_cache_tester.py pygccxml_dev/unittests/hierarchy_traveling.py pyplusplus_dev/examples/pyeasybmp_dev/pyeasybmp/environment.py pyplusplus_dev/pyplusplus/code_creators/algorithm.py pyplusplus_dev/pyplusplus/code_creators/calldef.py pyplusplus_dev/pyplusplus/code_creators/class_declaration.py pyplusplus_dev/pyplusplus/code_creators/code_creator.py pyplusplus_dev/pyplusplus/code_creators/compound.py pyplusplus_dev/pyplusplus/code_creators/include_directories.py pyplusplus_dev/pyplusplus/code_creators/indexing_suites.py pyplusplus_dev/pyplusplus/code_creators/module.py pyplusplus_dev/pyplusplus/decl_wrappers/algorithm.py pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite1.py pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py pyplusplus_dev/pyplusplus/file_writers/multiple_files.py pyplusplus_dev/pyplusplus/file_writers/writer.py pyplusplus_dev/pyplusplus/gui/ui.py pyplusplus_dev/pyplusplus/module_builder/builder.py pyplusplus_dev/pyplusplus/module_creator/class_organizer.py pyplusplus_dev/pyplusplus/module_creator/creator.py pyplusplus_dev/pyplusplus/module_creator/types_database.py pyplusplus_dev/pyplusplus/utils/__init__.py pyplusplus_dev/unittests/algorithms_tester.py pyplusplus_dev/unittests/autoconfig.py Modified: pydsc_dev/pydsc/pydsc.py =================================================================== --- pydsc_dev/pydsc/pydsc.py 2006-08-13 19:56:30 UTC (rev 398) +++ pydsc_dev/pydsc/pydsc.py 2006-08-14 07:05:16 UTC (rev 399) @@ -73,7 +73,6 @@ import inspect import __builtin__ from enchant import checker -from sets import Set as set #TODO: source code encoding Modified: pydsc_dev/unittests/to_be_tested.py =================================================================== --- pydsc_dev/unittests/to_be_tested.py 2006-08-13 19:56:30 UTC (rev 398) +++ pydsc_dev/unittests/to_be_tested.py 2006-08-14 07:05:16 UTC (rev 399) @@ -74,6 +74,7 @@ assert isinstance( code, types.StringTypes ) return code.strip() + @staticmethod def indent( code, size=1 ): """ function that implements code indent algorithm. @@ -82,8 +83,8 @@ return code_creator_t.__INDENTATION * size\ + code.replace( os.linesep , os.linesep + code_creator_t.__INDENTATION * size ) - indent = staticmethod( indent ) + @staticmethod def unindent( code ): """ function that implements code unindent algorithm. @@ -93,9 +94,8 @@ code = code[ len( code_creator_t.__INDENTATION ):] return code.replace( os.linesep + code_creator_t.__INDENTATION , os.linesep ) - unindent = staticmethod( unindent ) - #xyz + @staticmethod def is_comment( line ): """ function that returns true if content of the line is comment, otherwise @@ -105,4 +105,3 @@ l = line.lstrip() #1q2w3e4r-------------- return l.startswith( '//' ) or l.startswith( '/*' ) - is_comment = staticmethod( is_comment ) \ No newline at end of file Modified: pygccxml_dev/pygccxml/declarations/algorithm.py =================================================================== --- pygccxml_dev/pygccxml/declarations/algorithm.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/pygccxml/declarations/algorithm.py 2006-08-14 07:05:16 UTC (rev 399) @@ -6,7 +6,6 @@ """defines few unrelated algorithms, that works on declarations""" import types -from sets import Set as set def declaration_path( decl ): """ Modified: pygccxml_dev/pygccxml/declarations/cpptypes.py =================================================================== --- pygccxml_dev/pygccxml/declarations/cpptypes.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/pygccxml/declarations/cpptypes.py 2006-08-14 07:05:16 UTC (rev 399) @@ -379,6 +379,7 @@ type_t.__init__(self) calldef_type_t.__init__( self, return_type, arguments_types ) + @staticmethod def create_decl_string( return_type, arguments_types ): """ returns free function type @@ -393,8 +394,7 @@ return free_function_type_t.NAME_TEMPLATE % { 'return_type' : return_type.decl_string , 'arguments' : ','.join( map( lambda x: x.decl_string, arguments_types ) ) } - create_decl_string = staticmethod( create_decl_string ) - + def _create_decl_string(self): return self.create_decl_string( self.return_type, self.arguments_types ) @@ -465,6 +465,7 @@ , self.has_const ) + @staticmethod def create_decl_string(return_type, class_decl_string, arguments_types, has_const): has_const_str = '' if has_const: @@ -477,7 +478,6 @@ , 'class' : class_decl_string , 'arguments' : ','.join( map( lambda x: x.decl_string, arguments_types ) ) , 'has_const' : has_const_str } - create_decl_string = staticmethod( create_decl_string ) def _create_decl_string(self): return self.create_decl_string( self.return_type Modified: pygccxml_dev/pygccxml/declarations/declaration.py =================================================================== --- pygccxml_dev/pygccxml/declarations/declaration.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/pygccxml/declarations/declaration.py 2006-08-14 07:05:16 UTC (rev 399) @@ -99,10 +99,10 @@ cls = cls[:-2] return "%s [%s]"%(name, cls) + @staticmethod def _sorted_list( some_list ): some_list.sort() return some_list - _sorted_list = staticmethod( _sorted_list ) def _get__cmp__items( self ): """ Modified: pygccxml_dev/pygccxml/declarations/filtering.py =================================================================== --- pygccxml_dev/pygccxml/declarations/filtering.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/pygccxml/declarations/filtering.py 2006-08-14 07:05:16 UTC (rev 399) @@ -15,16 +15,17 @@ defines few algorithms for filtering declarations """ + @staticmethod def normalize_path( some_path ): """return os.path.normcase( os.path.normpath( some_path ) )""" return os.path.normcase( os.path.normpath( some_path ) ) - normalize_path = staticmethod( normalize_path ) - + + @staticmethod def contains_parent_dir( fpath, dirs ): #precondition: dirs and fpath should be normalize_path'ed before calling this function return bool( filter( lambda dir: fpath.startswith( dir ), dirs ) ) - contains_parent_dir = staticmethod( contains_parent_dir ) + @staticmethod def by_location( decls, locations ): """ returns list of declarations that belongs to specified locations. @@ -55,8 +56,8 @@ if filtering.contains_parent_dir( fpath, dirs ) or fpath in files: result.append( decl ) return result - by_location = staticmethod( by_location ) - + + @staticmethod def user_defined( decls, matcher ): """ returns list of declarations that match user specified criteria. @@ -73,5 +74,4 @@ """ #precondition: decls is a list of op level namespaces return filter( matcher, algorithm.make_flatten( decls ) ) - user_defined = staticmethod( user_defined ) Modified: pygccxml_dev/pygccxml/declarations/matcher.py =================================================================== --- pygccxml_dev/pygccxml/declarations/matcher.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/pygccxml/declarations/matcher.py 2006-08-14 07:05:16 UTC (rev 399) @@ -23,7 +23,8 @@ def __str__( self ): return "Multiple declarations has been found. matcher: [%s]"%str(self.matcher) - + + @staticmethod def find( decl_matcher, decls, recursive=True ): where = [] if isinstance( decls, types.ListType ): @@ -33,14 +34,14 @@ if recursive: where = algorithm.make_flatten( where ) return filter( decl_matcher, where ) - find = staticmethod( find ) - + + @staticmethod def find_single( decl_matcher, decls, recursive=True ): answer = matcher.find( decl_matcher, decls, recursive ) if len(answer) == 1: return answer[0] - find_single = staticmethod( find_single ) - + + @staticmethod def get_single( decl_matcher, decls, recursive=True ): answer = matcher.find( decl_matcher, decls, recursive ) if len(answer) == 1: @@ -49,4 +50,3 @@ 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 Modified: pygccxml_dev/pygccxml/declarations/pattern_parser.py =================================================================== --- pygccxml_dev/pygccxml/declarations/pattern_parser.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/pygccxml/declarations/pattern_parser.py 2006-08-14 07:05:16 UTC (rev 399) @@ -85,10 +85,7 @@ elif text[ found ] == self.__end: return ( first_occurance, found ) else: - pass - previous_found = found + 1 #skip found sep - #TODO: find out what is args and correct the code - return [ arg.strip() for arg in args ] + previous_found = found + 1 #skip found sep def split( self, decl_string ): assert self.has_pattern( decl_string ) Modified: pygccxml_dev/pygccxml/declarations/scopedef.py =================================================================== --- pygccxml_dev/pygccxml/declarations/scopedef.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/pygccxml/declarations/scopedef.py 2006-08-14 07:05:16 UTC (rev 399) @@ -402,7 +402,7 @@ , recursive=recursive , allow_empty=allow_empty) - def operator( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None, recursive=None ): + def operator( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): return self._find_single( self._impl_matchers[ scopedef_t.operator ] , name=self._build_operator_name( name, function, symbol ) , symbol=symbol @@ -414,7 +414,7 @@ , header_file=header_file , recursive=recursive ) - def operators( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None, recursive=None, allow_empty=None ): + def operators( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None ): return self._find_multiple( self._impl_matchers[ scopedef_t.operator ] , name=self._build_operator_name( name, function, symbol ) , symbol=symbol Modified: pygccxml_dev/pygccxml/declarations/type_traits.py =================================================================== --- pygccxml_dev/pygccxml/declarations/type_traits.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/pygccxml/declarations/type_traits.py 2006-08-14 07:05:16 UTC (rev 399) @@ -26,7 +26,6 @@ import templates import enumeration import class_declaration -from sets import Set as set import types as build_in_types def __remove_alias(tp, tp_is_clone): Modified: pygccxml_dev/pygccxml/parser/declarations_cache.py =================================================================== --- pygccxml_dev/pygccxml/parser/declarations_cache.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/pygccxml/parser/declarations_cache.py 2006-08-14 07:05:16 UTC (rev 399) @@ -94,28 +94,11 @@ def key(self): return ( self.__source_signature, self.__config_signature) + @staticmethod def create_key( source_file, configuration ): return ( file_signature(source_file) , configuration_signature(configuration)) - create_key = staticmethod( create_key ) - #def value(self): - #return ( self.__source_file_signature - #, self.__included_files - #, self.__included_files_signature - #, self.__declarations ) - - #def create( key, value ): - #return record_t( source_file=key[0] - #, working_directory=key[1] - #, include_paths=list(key[2]) - #, define_symbols=list(key[3]) - #, source_file_signature=value[0] - #, included_files=value[1] - #, included_files_signature=value[2] - #, declarations=value[3] ) - #create = staticmethod(create) - def __source_signature(self): return self.__source_signature source_signature = property( __source_signature ) @@ -155,6 +138,7 @@ for entry in self.__cache.itervalues(): # Clear hit flags entry.was_hit = False + @staticmethod def __load( file_name ): " Load pickled cache from file and return the object. " cache = None @@ -178,7 +162,6 @@ file(file_name, 'w+b').close() # Create empty file cache = {} # Empty cache return cache - __load = staticmethod( __load ) def flush(self): # If not marked as needing flushed, then return immediately Modified: pygccxml_dev/pygccxml/parser/project_reader.py =================================================================== --- pygccxml_dev/pygccxml/parser/project_reader.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/pygccxml/parser/project_reader.py 2006-08-14 07:05:16 UTC (rev 399) @@ -181,7 +181,8 @@ self.__decl_factory = pygccxml.declarations.decl_factory_t() self.logger = utils.loggers.gccxml - + + @staticmethod def get_os_file_names( files ): """Returns a list of OS file names @@ -200,7 +201,6 @@ else: pass return fnames - get_os_file_names = staticmethod( get_os_file_names ) def read_files( self, files, compilation_mode=COMPILATION_MODE.FILE_BY_FILE): """Parse header files. Modified: pygccxml_dev/unittests/autoconfig.py =================================================================== --- pygccxml_dev/unittests/autoconfig.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/unittests/autoconfig.py 2006-08-14 07:05:16 UTC (rev 399) @@ -9,7 +9,6 @@ #__pychecker__ = 'limit=1000' #import pychecker.checker - gccxml_path = '' data_directory = os.path.abspath( os.path.join( os.curdir, 'data' ) ) Modified: pygccxml_dev/unittests/core_tester.py =================================================================== --- pygccxml_dev/unittests/core_tester.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/unittests/core_tester.py 2006-08-14 07:05:16 UTC (rev 399) @@ -10,7 +10,6 @@ import autoconfig import parser_test_case from pprint import pformat -from sets import Set as set import pygccxml from pygccxml.utils import * Modified: pygccxml_dev/unittests/declaration_files_tester.py =================================================================== --- pygccxml_dev/unittests/declaration_files_tester.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/unittests/declaration_files_tester.py 2006-08-14 07:05:16 UTC (rev 399) @@ -6,7 +6,6 @@ import unittest import autoconfig import parser_test_case -from sets import Set as set import pygccxml from pygccxml.utils import * Modified: pygccxml_dev/unittests/file_cache_tester.py =================================================================== --- pygccxml_dev/unittests/file_cache_tester.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/unittests/file_cache_tester.py 2006-08-14 07:05:16 UTC (rev 399) @@ -12,7 +12,6 @@ import autoconfig import parser_test_case from pprint import pformat -from sets import Set as set import pygccxml from pygccxml.utils import * Modified: pygccxml_dev/unittests/hierarchy_traveling.py =================================================================== --- pygccxml_dev/unittests/hierarchy_traveling.py 2006-08-13 19:56:30 UTC (rev 398) +++ pygccxml_dev/unittests/hierarchy_traveling.py 2006-08-14 07:05:16 UTC (rev 399) @@ -7,7 +7,6 @@ import unittest import autoconfig import parser_test_case -from sets import Set as set from pygccxml import utils from pygccxml import parser Modified: pyplusplus_dev/examples/pyeasybmp_dev/pyeasybmp/environment.py =================================================================== --- pyplusplus_dev/examples/pyeasybmp_dev/pyeasybmp/environment.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/examples/pyeasybmp_dev/pyeasybmp/environment.py 2006-08-14 07:05:16 UTC (rev 399) @@ -20,10 +20,10 @@ generated_files_dir = '' unittests_dir = '' + @staticmethod def setup_environment(): sys.path.append( settings.pygccxml_path ) sys.path.append( settings.pyplusplus_path ) - setup_environment = staticmethod(setup_environment) if sys.platform == 'linux2': settings.boost_path = '/home/roman/boost_cvs' Modified: pyplusplus_dev/pyplusplus/code_creators/algorithm.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/algorithm.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/code_creators/algorithm.py 2006-08-14 07:05:16 UTC (rev 399) @@ -12,7 +12,6 @@ import types -import pygccxml import namespace def _make_flatten_list( creator_or_creators ): @@ -69,6 +68,8 @@ This class is used as container for different find algorithms. """ "creator_finder - this class used as namespace" + + @staticmethod def find_by_declaration( declaration_matcher, where, recursive=True ): """Finds code creator by declaration. declaration_matcher should be callable, that takes single argument @@ -83,18 +84,17 @@ return filter( lambda inst: isinstance( inst, declaration_based.declaration_based_t ) \ and declaration_matcher( inst.declaration ) , search_area ) - find_by_declaration = staticmethod( find_by_declaration ) - + + @staticmethod def find_by_declaration_single( declaration_matcher, where, recursive=True ): answer = creator_finder.find_by_declaration( declaration_matcher, where, recursive ) if len( answer ) == 1: return answer[0] return None - find_by_declaration_single = staticmethod( find_by_declaration_single ) + @staticmethod def find_by_class_instance( what, where, recursive=True ): search_area = where if recursive: search_area = make_flatten( where ) return filter( lambda inst: isinstance( inst, what ), search_area ) - find_by_class_instance = staticmethod( find_by_class_instance ) Modified: pyplusplus_dev/pyplusplus/code_creators/calldef.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/calldef.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/code_creators/calldef.py 2006-08-14 07:05:16 UTC (rev 399) @@ -3,7 +3,7 @@ # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -import os +import os import algorithm import declaration_based import class_declaration @@ -96,7 +96,7 @@ def _create_impl( self ): result = [] - if False == self.works_on_instance: + if not self.works_on_instance: exported_class_alias = None if declarations.templates.is_instantiation( self.declaration.parent.name ): exported_class_alias = self.exported_class_alias @@ -1021,7 +1021,7 @@ elif arg0 != arg1 and arg1 == parent_decl_string: return operator_t.SELF_POSITION.SECOND else: - assert 0 #I have bug some where + assert not "Unable to find out boost::python::self position. " + str( self.declaration ) def _create_binary_operator(self): answer = [ None, self.declaration.symbol, None ] Modified: pyplusplus_dev/pyplusplus/code_creators/class_declaration.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/class_declaration.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/code_creators/class_declaration.py 2006-08-14 07:05:16 UTC (rev 399) @@ -72,7 +72,7 @@ return os.linesep.join( result ) def _create_impl(self): - if self.is_exposed_using_scope: + if self.is_exposed_using_scope(): return self._generate_code_with_scope() else: return self._generate_code_no_scope() Modified: pyplusplus_dev/pyplusplus/code_creators/code_creator.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/code_creator.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/code_creators/code_creator.py 2006-08-14 07:05:16 UTC (rev 399) @@ -110,7 +110,8 @@ """ assert isinstance( code, types.StringTypes ) return code.strip() - + + @staticmethod def indent( code, size=1 ): """ function that implements code indent algorithm. @@ -126,8 +127,8 @@ return code_creator_t.__INDENTATION * size\ + code.replace( os.linesep , os.linesep + code_creator_t.__INDENTATION * size ) - indent = staticmethod( indent ) - + + @staticmethod def unindent( code ): """ function that implements code unindent algorithm. @@ -141,8 +142,8 @@ code = code[ len( code_creator_t.__INDENTATION ):] return code.replace( os.linesep + code_creator_t.__INDENTATION , os.linesep ) - unindent = staticmethod( unindent ) - + + @staticmethod def is_comment( line ): """ function that returns true if content of the line is comment, otherwise @@ -155,4 +156,3 @@ assert isinstance( line, types.StringTypes ) l = line.lstrip() return l.startswith( '//' ) or l.startswith( '/*' ) - is_comment = staticmethod( is_comment ) Modified: pyplusplus_dev/pyplusplus/code_creators/compound.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/compound.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/code_creators/compound.py 2006-08-14 07:05:16 UTC (rev 399) @@ -60,6 +60,7 @@ creator.parent = None del self._creators[ self._creators.index( creator ) ] + @staticmethod def create_internal_code( creators ): """Concatenate the code from a list of code creators. @@ -74,4 +75,3 @@ for index in range( len( internals ) - 1): internals[index] = internals[index] + os.linesep return os.linesep.join( internals ) - create_internal_code = staticmethod( create_internal_code ) Modified: pyplusplus_dev/pyplusplus/code_creators/include_directories.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/include_directories.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/code_creators/include_directories.py 2006-08-14 07:05:16 UTC (rev 399) @@ -18,9 +18,9 @@ self._user_defined = [] self._std = [] + @staticmethod def normalize( path ): return os.path.normpath( os.path.normcase( path ) ) - normalize = staticmethod( normalize ) def _get_user_defined(self): self._user_defined = map( self.normalize, self._user_defined ) Modified: pyplusplus_dev/pyplusplus/code_creators/indexing_suites.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/indexing_suites.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/code_creators/indexing_suites.py 2006-08-14 07:05:16 UTC (rev 399) @@ -58,7 +58,6 @@ or bool( self.declaration.indexing_suite.disable_methods ) def generate_algorithm_mask( self ): - indexing = algorithm.create_identifier(self, "::boost::python::indexing" ) disable = [] for group in self.declaration.indexing_suite.disabled_methods_groups: group_id = algorithm.create_identifier(self, "::boost::python::indexing::%s_methods" % group ) Modified: pyplusplus_dev/pyplusplus/code_creators/module.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/module.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/code_creators/module.py 2006-08-14 07:05:16 UTC (rev 399) @@ -173,7 +173,7 @@ self.adopt_include( include.include_t( header=header ) ) def add_namespace_usage( self, namespace_name ): - self.adopt_creator( namespace.namespace_using_t( 'boost' ) + self.adopt_creator( namespace.namespace_using_t( namespace_name ) , self.last_include_index() + 1 ) def add_namespace_alias( self, alias, full_namespace_name ): Modified: pyplusplus_dev/pyplusplus/decl_wrappers/algorithm.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/algorithm.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/decl_wrappers/algorithm.py 2006-08-14 07:05:16 UTC (rev 399) @@ -9,7 +9,6 @@ """ import re -import pygccxml def creators_affect_on_me( me ): """This algorithm finds all code creators that can influence on code generated Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2006-08-14 07:05:16 UTC (rev 399) @@ -187,13 +187,14 @@ all = inplace + comparison + non_member + unary + @staticmethod def is_supported( oper ): if oper.symbol == '*' and len( oper.arguments ) == 0: #dereference does not make sense return False return oper.symbol in operators_helper.all - is_supported = staticmethod( is_supported ) - + + @staticmethod def exportable( oper ): if isinstance( oper, declarations.member_operator_t ) and oper.symbol in ( '()', '[]' ): return '' @@ -202,8 +203,7 @@ msg.append( 'See Boost.Python documentation: http://www.boost.org/libs/python/doc/v2/operators.html#introduction.' ) return ' '.join( msg ) return '' - exportable = staticmethod( exportable ) - + class member_operator_t( declarations.member_operator_t, calldef_t ): def __init__(self, *arguments, **keywords): declarations.member_operator_t.__init__( self, *arguments, **keywords ) @@ -226,7 +226,7 @@ class casting_operator_t( declarations.casting_operator_t, calldef_t ): - + def prepare_special_cases(): """ Creates a map of special cases ( aliases ) for casting operator. Modified: pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py 2006-08-14 07:05:16 UTC (rev 399) @@ -3,8 +3,6 @@ # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -import os -import sys import algorithm from pyplusplus import _logging_ from pygccxml import declarations Modified: pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite1.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite1.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite1.py 2006-08-14 07:05:16 UTC (rev 399) @@ -20,7 +20,7 @@ def __init__( self, container_class, container_traits, no_proxy=None, derived_policies=None ): object.__init__( self ) self.__no_proxy = no_proxy - self.__derived_policies = None + self.__derived_policies = derived_policies self.__container_class = container_class self.__container_traits = container_traits Modified: pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py 2006-08-14 07:05:16 UTC (rev 399) @@ -6,7 +6,6 @@ import os import writer import multiple_files -from sets import Set as set from pygccxml import declarations from pyplusplus import decl_wrappers from pyplusplus import code_creators @@ -186,8 +185,6 @@ return super( class_multiple_files_t, self ).split_class_impl( class_creator ) class_creator.declaration.always_expose_using_scope = True - extmodule = class_creator.top_parent - function_name = 'register_%s_class' % class_creator.alias file_path = os.path.join( self.directory_path, class_creator.alias ) Modified: pyplusplus_dev/pyplusplus/file_writers/multiple_files.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/multiple_files.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/file_writers/multiple_files.py 2006-08-14 07:05:16 UTC (rev 399) @@ -5,7 +5,6 @@ import os import writer -from sets import Set as set from pygccxml import declarations from pyplusplus import decl_wrappers from pyplusplus import code_creators @@ -19,7 +18,7 @@ HEADER_EXT = '.pypp.hpp' SOURCE_EXT = '.pypp.cpp' - def __init__(self, extmodule, directory_path): + def __init__(self, extmodule, directory_path, write_main=True): """Constructor. @param extmodule: The root of a code creator tree @@ -32,7 +31,8 @@ self.create_dir( directory_path ) self.include_creators = [] # List of include_t creators that contain the generated headers self.split_header_names = [] # List of include file names for split files - self.split_method_names = [] # List of methods from the split files + self.split_method_names = [] # List of methods from the split files + self.write_main = write_main def create_dir( self, directory_path ): @@ -291,7 +291,7 @@ self.split_creators( creators, '_free_functions', 'register_free_functions', -1 ) #TODO: move write_main to __init__ - def write(self, write_main=True): + def write(self): """ Write out the module. Creates a separate source/header combo for each class and for enums, globals, and free functions. @@ -319,7 +319,7 @@ self.split_global_variables() self.split_free_functions() - if write_main: + if self.write_main: self.include_creators.sort( cmp=lambda ic1, ic2: cmp( ic1.header, ic2.header ) ) map( lambda creator: self.extmodule.adopt_include( creator ) , self.include_creators ) Modified: pyplusplus_dev/pyplusplus/file_writers/writer.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/writer.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/file_writers/writer.py 2006-08-14 07:05:16 UTC (rev 399) @@ -34,6 +34,7 @@ """ Main write method. Should be overridden by derived classes. """ raise NotImplementedError() + @staticmethod def create_backup(fpath): if not os.path.exists( fpath ): return @@ -41,13 +42,13 @@ if os.path.exists( backup_fpath ): os.remove( backup_fpath ) os.rename( fpath, backup_fpath ) - create_backup = staticmethod( create_backup ) def write_code_repository(self, dir): for cr in code_repository.all: if self.__extmodule.is_system_header( cr.file_name ): self.write_file( os.path.join( dir, cr.file_name ), cr.code ) + @staticmethod def write_file( fpath, content ): """Write a source file. @@ -87,5 +88,3 @@ f.write( fcontent_new ) f.close() writer_t.logger.info( 'file "%s" - updated( %f seconds )' % ( fname, time.clock() - start_time ) ) - - write_file = staticmethod( write_file ) Modified: pyplusplus_dev/pyplusplus/gui/ui.py =================================================================== --- pyplusplus_dev/pyplusplus/gui/ui.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/gui/ui.py 2006-08-14 07:05:16 UTC (rev 399) @@ -5,7 +5,6 @@ # http://www.boost.org/LICENSE_1_0.txt) import os -import sys import time import Tkinter import tkFileDialog Modified: pyplusplus_dev/pyplusplus/module_builder/builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/builder.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/module_builder/builder.py 2006-08-14 07:05:16 UTC (rev 399) @@ -6,10 +6,7 @@ import os import sys import time -import types -from sets import Set as set - from pygccxml import parser from pygccxml import declarations as decls_package @@ -34,7 +31,6 @@ , define_symbols=None , undefine_symbols=None , start_with_declarations=None - , compilation_verbose=False , compilation_mode=None , cache=None , optimize_queries=True @@ -444,7 +440,7 @@ , header_file=header_file , recursive=recursive) - def member_operator( self, name=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): + def member_operator( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.member_operator( name=name , symbol=symbol @@ -455,7 +451,7 @@ , header_file=header_file , recursive=recursive ) - def member_operators( self, name=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): + def member_operators( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): """Please see L{decl_wrappers.scopedef_t} class documentation""" return self.global_ns.member_operators( name=name , symbol=symbol Modified: pyplusplus_dev/pyplusplus/module_creator/class_organizer.py =================================================================== --- pyplusplus_dev/pyplusplus/module_creator/class_organizer.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/module_creator/class_organizer.py 2006-08-14 07:05:16 UTC (rev 399) @@ -4,7 +4,6 @@ # http://www.boost.org/LICENSE_1_0.txt) from pygccxml import declarations -from sets import Set as set class COLOR: WHITE = 0 Modified: pyplusplus_dev/pyplusplus/module_creator/creator.py =================================================================== --- pyplusplus_dev/pyplusplus/module_creator/creator.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/module_creator/creator.py 2006-08-14 07:05:16 UTC (rev 399) @@ -2,9 +2,7 @@ # 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 time + import types_database import class_organizer import call_policies_resolver @@ -364,7 +362,7 @@ elif not creator: pass else: - assert 0 + assert not "Found %d class code creators" % len(creator) find = code_creators.creator_finder.find_by_declaration if isinstance( operator.parent, declarations.class_t ): found = find( lambda decl: operator.parent is decl @@ -393,7 +391,7 @@ and ( creator.target is registered.target ): return True else: - assert 0 #unknown instace of registrator + assert not "unknown instace of registrator: " % str( registered ) def _treat_smart_pointers( self ): """ Go to all class creators and apply held_type and creator registrators Modified: pyplusplus_dev/pyplusplus/module_creator/types_database.py =================================================================== --- pyplusplus_dev/pyplusplus/module_creator/types_database.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/module_creator/types_database.py 2006-08-14 07:05:16 UTC (rev 399) @@ -3,7 +3,6 @@ # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -import os from pygccxml import declarations from pyplusplus import code_creators from pyplusplus import _logging_ @@ -29,7 +28,7 @@ elif isinstance( decl, declarations.variable_t ): self._update_db( self.__variables, decl.type ) else: - assert 0 + assert not "types_database_t class can not process " + str( decl ) def _is_relevant(self, decl_string): for smart_ptr in self.__smart_ptrs: @@ -49,30 +48,31 @@ answer = answer.replace( ' ' + data, data ) return answer.replace( ' ', ' ' ) - def _update_containers_db( self, type ): + def _update_containers_db( self, type_ ): #will return True is type was treated - type = declarations.remove_alias( type ) - type = declarations.remove_pointer( type ) - type = declarations.remove_reference( type ) - type = declarations.remove_cv( type ) - type = declarations.remove_declarated( type ) + type_ = declarations.remove_alias( type_ ) + type_ = declarations.remove_pointer( type_ ) + type_ = declarations.remove_reference( type_ ) + type_ = declarations.remove_cv( type_ ) + type_ = declarations.remove_declarated( type_ ) class_traits = declarations.class_traits class_declaration_traits = declarations.class_declaration_traits - if not class_traits.is_my_case( type ) and not class_declaration_traits.is_my_case( type ): + if not class_traits.is_my_case( type_ ) and not class_declaration_traits.is_my_case( type_ ): return False - if class_traits.is_my_case( type ): - container_cls = class_traits.get_declaration( type ) + if class_traits.is_my_case( type_ ): + container_cls = class_traits.get_declaration( type_ ) else: - container_cls = class_declaration_traits.get_declaration( type ) + container_cls = class_declaration_traits.get_declaration( type_ ) if None is container_cls.indexing_suite: return False try: - check_extraction = container_cls.indexing_suite.element_type - except RuntimeError, error: + #check extraction of element type from container + container_cls.indexing_suite.element_type + except RuntimeError: msg = "%s;%s" \ % ( str(container_cls) , "pyplusplus can not find out container value_type( mapped_type )." Modified: pyplusplus_dev/pyplusplus/utils/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/utils/__init__.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/pyplusplus/utils/__init__.py 2006-08-14 07:05:16 UTC (rev 399) @@ -13,6 +13,8 @@ class missing_call_policies: + + @staticmethod def _selector( creator ): if not isinstance( creator, code_creators.declaration_based_t ): return False @@ -21,8 +23,8 @@ if isinstance( creator.declaration, declarations.constructor_t ): return False return hasattr(creator, 'call_policies') and not creator.call_policies - _selector = staticmethod( _selector ) - + + @staticmethod def print_( extmodule ): creators = filter( missing_call_policies._selector , code_creators.make_flatten( extmodule.creators ) ) @@ -30,15 +32,14 @@ print creator.declaration.__class__.__name__, ': ', declarations.full_name( creator.declaration ) print ' *** MISSING CALL POLICY', creator.declaration.function_type().decl_string print - print_ = staticmethod( print_ ) - + + @staticmethod def exclude( extmodule ): creators = filter( missing_call_policies._selector , code_creators.make_flatten( extmodule.creators ) ) for creator in creators: creator.parent.remove_creator( creator ) - exclude = staticmethod( exclude ) - + def split_sequence(seq, bucket_size): #split sequence to buclets, where every will contain maximum bucket_size items Modified: pyplusplus_dev/unittests/algorithms_tester.py =================================================================== --- pyplusplus_dev/unittests/algorithms_tester.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/unittests/algorithms_tester.py 2006-08-14 07:05:16 UTC (rev 399) @@ -7,7 +7,6 @@ import sys import unittest import autoconfig -from sets import Set as set from pygccxml import parser from pygccxml import declarations from pyplusplus import code_creators Modified: pyplusplus_dev/unittests/autoconfig.py =================================================================== --- pyplusplus_dev/unittests/autoconfig.py 2006-08-13 19:56:30 UTC (rev 398) +++ pyplusplus_dev/unittests/autoconfig.py 2006-08-14 07:05:16 UTC (rev 399) @@ -7,11 +7,7 @@ import os import sys import unittest -from sets import Set as set - -#sys.path.append( os.path.join( os.curdir, '..' ) ) - #__pychecker__ = 'limit=1000' #import pychecker.checker @@ -28,6 +24,7 @@ cpppath = [ boost.include, python.include ] include_dirs = cpppath + [data_directory] + @staticmethod def create_sconstruct(): code = [ "SharedLibrary( target=r'%(target)s'" @@ -40,7 +37,6 @@ , " , SHLIBSUFFIX='%s'" % scons.suffix #explicit better then implicit , ")" ] return os.linesep.join( code ) - create_sconstruct = staticmethod(create_sconstruct) #I need this in order to allow Python to load just compiled modules sys.path.append( build_dir ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-13 19:56:38
|
Revision: 398 Author: roman_yakovenko Date: 2006-08-13 12:56:30 -0700 (Sun, 13 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=398&view=rev Log Message: ----------- reviewing architecture document Modified Paths: -------------- pyplusplus_dev/docs/documentation/architecture.rest Modified: pyplusplus_dev/docs/documentation/architecture.rest =================================================================== --- pyplusplus_dev/docs/documentation/architecture.rest 2006-08-13 11:08:45 UTC (rev 397) +++ pyplusplus_dev/docs/documentation/architecture.rest 2006-08-13 19:56:30 UTC (rev 398) @@ -8,7 +8,7 @@ Introduction ------------ -This document will describe an architecture behind `pyplusplus`_. +This document will describe an architecture behind `pyplusplus`_. --- C++ @@ -55,8 +55,8 @@ ------------------- `pyplusplus`_ provides it's own "API" to configure and run `pygccxml`_ parsing services. The "API" I am talking about, is arguments to ``module_builder.__init__`` -method. This method takes all arguments needed to envoke parsing services. This -has been done to simplify the usage of `pyplusplus`_. +method. The method takes all arguments, needed to envoke parsing services. It +has been done this way to simplify the usage of `pyplusplus`_. Declarations tree integration @@ -114,7 +114,7 @@ 1. ``pygccxml.parser`` package interface was extendent. Instead of creating a concrete instance of declaration classes, ``pygccxml.parser`` package uses - factory. + a factory. 2. ``pyplusplus.decl_wrappers`` package defines classes, that derive from ``pygccxml.declarations`` classes and defines the factory. @@ -122,7 +122,8 @@ Also, this solution is not the simplest one, it provides an additional value to the project: -* code generation engine configuration and declarations tree are tightly coupled +* the code generation engine configuration and declarations tree are tightly + coupled * all functionality provided by ``pygccxml.declarations`` and ``pygccxml.parser`` packages is available for ``pyplusplus.decl_wrappers`` classes @@ -141,10 +142,9 @@ Code generation engine ---------------------- -Code generation for `Boost.Python`_ library is a difficult process. I don't know -what about you, but when I have to solve some complex task, I prefer to use -`divide and conquer`_ paradigm. There are 2 different problems the code generation -engine should solve: +Code generation for `Boost.Python`_ library is a difficult process. It is very +difficult to solve it as is. I prefer to apply `divide and conquer`_ paradigm. +There are 2 different problems the engine should solve: .. _`divide and conquer` : http://en.wikipedia.org/wiki/Divide_and_conquer_algorithm @@ -158,11 +158,11 @@ * How it should be written to files? Remember, `pyplusplus`_ is targeting big projects. It can not generate all code - in one file - this will not work, not at all. - + in one file - this will not work, not at all. + Code creators and file writers provides solution to this problem. + - Code creators ------------- @@ -199,13 +199,13 @@ * ``code_creators.include_t`` generates include directives * ``code_creators.custom_text_t`` adds some custom( read user ) text\\code to - the generated code + the generated code -As you can see, there are primary 2 kinds of ``code creator``'s: declaration based -and others. Declaration based creator generates code, that is needed to export -the declaration. There a lot of use cases, where in order to export a declaration, -`pyplusplus`_ builds more then one ``code creator``. For example: in order to -export virtual function 2 ``code creator``'s are built: +As you can see, there are primary 2 kinds of ``code creator``'s: declaration +based and others. Declaration based creator generates code, that is needed to +export the declaration. There a lot of use cases, where in order to export a +declaration, `pyplusplus`_ builds more then one ``code creator``. For example: +in order to export virtual function 2 ``code creator``'s are built: ( I will reuse example from `Boost.Python`_ `tutorials`__.) @@ -222,12 +222,11 @@ to the declaration configuration. ``Code creator``'s are the only classes, that generate the code! + +Composite ``code creator`` is a creator, that contains other creators. Composite +``code creator`` embeds the code, created by internal ``code creator``'s, within +the code it creates. For example: -Now when you understand, what ``code creator`` is, it is a time to move on - -composite code creator. Composite ``code creator`` is a creator, that contains -other creators. Composite ``code creator`` embeds the code, created by internal -``code creator``'s, within the code it creates. For example: - * ``code_creators.class_t``: First of all it creates class registration code ( ``class_<...>`` ), after @@ -252,7 +251,7 @@ ``code_creators.module_t`` code creator is a top level code creator. It is a composite ``code creator`` too. Take a look on next possible "snapshot" of the -code creators structure: +``code creators tree``: :: @@ -286,14 +285,14 @@ There is one interesting thing about this class you should know: this is the only class that "sees" all declarations. It monitors all exported functions and variables. Thus it knows that class ``X`` is used with ``boost::shared_ptr``, -so it will set ``class_`` ``HeldType`` to be ``boost::shared_ptr`` or will register -the usage of it. Another interesting example is std containers. You don't have +so it will set ``class_<X>`` ``HeldType`` to be ``boost::shared_ptr`` or will +register its usage. Another interesting example is std containers. You don't have to say to `pyplusplus`_ to export them, it will do it by itself. You may ask -why this detail is interesting? Because the user does not have to specify all -set of declarations he wants to export! Because, it is possible to implement -( and we will be implemented ) next feature. `pyplusplus`_ will generate warning -if an user exports functon ``f``, that uses non-exported class ``Y``. -``pyplusplus.module_creator.types_database_t`` will have this functionality. +why this detail is so interesting? Because the user does not have to specify all +set of declarations he wants to export! Because, in near future, `pyplusplus`_ +will analize declarations dependency graph of exported declarations. If some +declaration should be exported and it is not, then `pyplusplus`_ will warn the +user. @@ -301,9 +300,8 @@ ------------ ``File writer``'s classes is responcible for writting `code creators tree`` into -files. `pyplusplus`_ was built to deal with big projects, nevetherless it handles -small projects very well too. Do you want to see how ``file_writers.single_file_t`` -code looks that writes created code to file? +files. Lets take a look on few lines of code from ``file_writers.single_file_t`` +class. :: @@ -311,8 +309,11 @@ #write_file will write the code to file only if needed. #extmodule is an instance of code_creators.module_t class self.write_file( self.file_name, self.extmodule.create() ) + # ^^^^^^^^^^^^^^^^^^^^^^^ +``single_file_t`` does not know any ``code creator``, except the ``module_t``! +``File writer``'s do not know and will not know all ``code creator``'s. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-13 11:08:55
|
Revision: 397 Author: roman_yakovenko Date: 2006-08-13 04:08:45 -0700 (Sun, 13 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=397&view=rev Log Message: ----------- adding few test cases Modified Paths: -------------- pyplusplus_dev/unittests/data/default_args_to_be_exported.hpp pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp pyplusplus_dev/unittests/enums_tester.py pyplusplus_dev/unittests/member_variables_tester.py Modified: pyplusplus_dev/unittests/data/default_args_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/default_args_to_be_exported.hpp 2006-08-13 08:46:39 UTC (rev 396) +++ pyplusplus_dev/unittests/data/default_args_to_be_exported.hpp 2006-08-13 11:08:45 UTC (rev 397) @@ -10,7 +10,7 @@ struct data{ int sum( int i=0 ){ return i; } - int sum( int i, int j, int k=3 ){ return i + j + k; } + int sum( int a, int b, int c=1, int d=2 ){ return a + b + c + d; } }; } Modified: pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp =================================================================== --- pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp 2006-08-13 08:46:39 UTC (rev 396) +++ pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp 2006-08-13 11:08:45 UTC (rev 397) @@ -37,6 +37,9 @@ } } - + +namespace statics{ + std::string mem_var_str_t::class_name( "mem_var_str_t" ); } +} Modified: pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp 2006-08-13 08:46:39 UTC (rev 396) +++ pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp 2006-08-13 11:08:45 UTC (rev 397) @@ -6,6 +6,7 @@ #ifndef __member_variables_to_be_exported_hpp__ #define __member_variables_to_be_exported_hpp__ #include <memory> +#include <string> namespace member_variables{ @@ -130,7 +131,17 @@ C( A& a_ ): a( a_ ){} const A& a; }; + } + +namespace statics{ + +struct mem_var_str_t{ + static std::string class_name; + std::string identity(std::string x){ return x; } +}; + +} } #endif//__member_variables_to_be_exported_hpp__ Modified: pyplusplus_dev/unittests/enums_tester.py =================================================================== --- pyplusplus_dev/unittests/enums_tester.py 2006-08-13 08:46:39 UTC (rev 396) +++ pyplusplus_dev/unittests/enums_tester.py 2006-08-13 11:08:45 UTC (rev 397) @@ -33,7 +33,8 @@ self.failUnless( module.Color.BLUE == 4 ) self.failUnless( module.RED ) self.failUnless( module.BLUE ) - self.failIfNotRaisesAny( lambda: self.get_green( module ) ) + self.failIfNotRaisesAny( lambda: self.get_green( module ) ) + self.failUnless( 1 == module.to_int( 1 ) ) def create_suite(): suite = unittest.TestSuite() Modified: pyplusplus_dev/unittests/member_variables_tester.py =================================================================== --- pyplusplus_dev/unittests/member_variables_tester.py 2006-08-13 08:46:39 UTC (rev 396) +++ pyplusplus_dev/unittests/member_variables_tester.py 2006-08-13 11:08:45 UTC (rev 397) @@ -84,8 +84,10 @@ #self.failUnless( tree.right.right is None ) #self.failUnless( tree.right.left ) #self.failUnless( tree.right.left.data.value == 1 ) + + mem_var_str = module.mem_var_str_t() + mem_var_str.identity( module.mem_var_str_t.class_name ) - def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-13 08:46:47
|
Revision: 396 Author: roman_yakovenko Date: 2006-08-13 01:46:39 -0700 (Sun, 13 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=396&view=rev Log Message: ----------- adding new test case Modified Paths: -------------- pyplusplus_dev/unittests/data/indexing_suites2_to_be_exported.hpp pyplusplus_dev/unittests/indexing_suites2_tester.py Modified: pyplusplus_dev/unittests/data/indexing_suites2_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/indexing_suites2_to_be_exported.hpp 2006-08-13 08:27:03 UTC (rev 395) +++ pyplusplus_dev/unittests/data/indexing_suites2_to_be_exported.hpp 2006-08-13 08:46:39 UTC (rev 396) @@ -8,6 +8,7 @@ #include <vector> #include <string> +#include <map> namespace indexing_suites2 { @@ -43,6 +44,16 @@ typedef std::vector<float> fvector; fvector empty_fvector(){ return fvector(); } + +typedef std::map< std::string, std::string > name2value_t; +inline std::string get_first_name( name2value_t const * names ){ + if( !names ){ + return ""; + } + else{ + return names->begin()->first; + } +} } Modified: pyplusplus_dev/unittests/indexing_suites2_tester.py =================================================================== --- pyplusplus_dev/unittests/indexing_suites2_tester.py 2006-08-13 08:27:03 UTC (rev 395) +++ pyplusplus_dev/unittests/indexing_suites2_tester.py 2006-08-13 08:46:39 UTC (rev 396) @@ -21,15 +21,6 @@ , indexing_suite_version=2 , *args) - #~ @staticmethod - #~ def matcher( item, decl ): - #~ if not declarations.vector_traits.is_my_case( decl ): - #~ return False - #~ value_type = declarations.vector_traits.value_type(decl) - #~ if item is value_type: - #~ return True - #~ return False - def customize(self, generator): fvector = generator.global_ns.typedef( 'fvector' ) fvector = declarations.remove_declarated( fvector.type ) @@ -42,13 +33,17 @@ self.failUnless( not hasattr( fv, 'extend' ) ) self.failUnless( not hasattr( fv, 'sort' ) ) self.failUnless( not hasattr( fv, 'reverse' ) ) - #~ items = module.items_t() - #~ item = module.item_t() - #~ item.value = 1977 - #~ items.append( item ) - #~ self.failUnless( module.get_value( items, 0 ).value == 1977 ) - #~ self.failUnless( len( items ) == 1 ) - + items = module.items_t() + item = module.item_t() + item.value = 1977 + items.append( item ) + self.failUnless( module.get_value( items, 0 ).value == 1977 ) + self.failUnless( len( items ) == 1 ) + + name2value = module.name2value_t() + name2value[ "x" ] = "y" + self.failUnless( "x" == module.get_first_name( name2value ) ) + def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-13 08:27:17
|
Revision: 395 Author: roman_yakovenko Date: 2006-08-13 01:27:03 -0700 (Sun, 13 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=395&view=rev Log Message: ----------- renaming 'boost.xxx' to 'Boost.Xxx' Modified Paths: -------------- index.rest pyplusplus_dev/docs/examples/boost/boost.rest pyplusplus_dev/docs/examples/examples.rest pyplusplus_dev/docs/quotes.rest Modified: index.rest =================================================================== --- index.rest 2006-08-13 06:36:07 UTC (rev 394) +++ index.rest 2006-08-13 08:27:03 UTC (rev 395) @@ -36,11 +36,11 @@ `Boost`_ provides free peer-reviewed portable C++ source libraries. `pyboost`_ package export next libraries to Python: - * `boost.date_time`_ - date time library designed to provide a basis for + * `Boost.Date_Time`_ - date time library designed to provide a basis for performing efficient time calculations - * `boost.crc`_ - cyclic redundancy code computation objects - * `boost.rational`_ - rational number class - * `boost.random`_ - a complete system for random number generation + * `Boost.CRC`_ - cyclic redundancy code computation objects + * `Boost.Rational`_ - rational number class + * `Boost.Random`_ - a complete system for random number generation Python bindings for `boost.graph`_ library is also available from http://www.osl.iu.edu/~dgregor/bgl-python . Modified: pyplusplus_dev/docs/examples/boost/boost.rest =================================================================== --- pyplusplus_dev/docs/examples/boost/boost.rest 2006-08-13 06:36:07 UTC (rev 394) +++ pyplusplus_dev/docs/examples/boost/boost.rest 2006-08-13 08:27:03 UTC (rev 395) @@ -39,10 +39,10 @@ flexible. `pyplusplus`_ is a new tool and in my opinion I should prove its usefulness. Using `pyplusplus`_, I exposed next libraries to Python: - * `boost.date_time`_ - * `boost.crc`_ - * `boost.rational`_ - * `boost.random`_ + * `Boost.Date_Time`_ + * `Boost.CRC`_ + * `Boost.Rational`_ + * `Boost.Random`_ There are few reasons I choose to expose those libraries. @@ -55,11 +55,11 @@ * clear concepts * comprehensive unit tests -3. I think, that Python is missing functionality provided by `boost.date_time`_ - and `boost.random`_ libraries. +3. I think, that Python is missing functionality provided by `Boost.Date_Time`_ + and `Boost.Random`_ libraries. I spent different amount of time on each library. It took me one week, to expose -the `boost.date_time`_ library. I added few missing features to `pyplusplus`_, +the `Boost.Date_Time`_ library. I added few missing features to `pyplusplus`_, polished the existing ones. Most of the time I spent translating tests from C++ to `Python`_. It took me 3 days to expose all other libraries. Modified: pyplusplus_dev/docs/examples/examples.rest =================================================================== --- pyplusplus_dev/docs/examples/examples.rest 2006-08-13 06:36:07 UTC (rev 394) +++ pyplusplus_dev/docs/examples/examples.rest 2006-08-13 08:27:03 UTC (rev 395) @@ -32,10 +32,10 @@ Using `pyplusplus`_ I created Python bindings for few libraries: - * `boost.date_time`_ - * `boost.crc`_ - * `boost.rational`_ - * `boost.random`_ + * `Boost.Date_Time`_ + * `Boost.CRC`_ + * `Boost.Rational`_ + * `Boost.Random`_ This is not "just another example". I went father and created new package: `pyboost`_. This is fully working Python package, with almost all unit test from Modified: pyplusplus_dev/docs/quotes.rest =================================================================== --- pyplusplus_dev/docs/quotes.rest 2006-08-13 06:36:07 UTC (rev 394) +++ pyplusplus_dev/docs/quotes.rest 2006-08-13 08:27:03 UTC (rev 395) @@ -51,10 +51,10 @@ * I am :-). I created Python bindings for next libraries: - * `boost.date_time`_ - * `boost.crc`_ - * `boost.rational`_ - * `boost.random`_ + * `Boost.Date_Time`_ + * `Boost.CRC`_ + * `Boost.Rational`_ + * `Boost.Random`_ .. _`boost.date_time` : http://boost.org/doc/html/date_time.html .. _`boost.crc` : http://boost.org/libs/crc/index.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-13 06:36:14
|
Revision: 394 Author: roman_yakovenko Date: 2006-08-12 23:36:07 -0700 (Sat, 12 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=394&view=rev Log Message: ----------- adding language-binding.net main page to the repository Added Paths: ----------- index.rest Added: index.rest =================================================================== --- index.rest (rev 0) +++ index.rest 2006-08-13 06:36:07 UTC (rev 394) @@ -0,0 +1,86 @@ +=========================== +C++ Python language binding +=========================== + +.. contents:: Table of contents + +---------------- +pygccxml package +---------------- + +* Do you need to parse C++ code? +* Do you need to build code generator? +* Do you need to create UML diagram? + +`pygccxml`_ is the way to go! `Learn more`__. + +.. __: `pygccxml`_ + +------------------ +pyplusplus package +------------------ + +"I love deadlines. I love the whooshing noise they make as they go by." + + -- Douglas Adams + +Meet your deadlines with powerful code generator engine - `pyplusplus`_. + +`pyplusplus`_ package and `Boost.Python`_ library provide a complete solution for +interfacing Python and C++. + +--------------- +pyboost package +--------------- + +`Boost`_ provides free peer-reviewed portable C++ source libraries. `pyboost`_ +package export next libraries to Python: + + * `boost.date_time`_ - date time library designed to provide a basis for + performing efficient time calculations + * `boost.crc`_ - cyclic redundancy code computation objects + * `boost.rational`_ - rational number class + * `boost.random`_ - a complete system for random number generation + +Python bindings for `boost.graph`_ library is also available from +http://www.osl.iu.edu/~dgregor/bgl-python . + +------------- +pydsc package +------------- + +Documentation strings contain spelling errors? `Fix them in a minute`_. + +.. _`Fix them in a minute` : `pydsc`_ + +----------------- +pyeasybmp package +----------------- + +`EasyBMP`_ could be easier? Yes of course! Learn more about `EasyBMP Python bindings`_. + +.. _`EasyBMP Python bindings`: ./pyplusplus/examples/easybmp/easybmp.html + +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html + +.. _`pyboost` : ./pyplusplus/examples/boost/boost.html +.. _`boost.graph` : http://www.boost.org/libs/graph/doc/table_of_contents.html +.. _`boost.date_time` : http://boost.org/doc/html/date_time.html +.. _`boost.crc` : http://boost.org/libs/crc/index.html +.. _`boost.rational` : http://boost.org/libs/rational/index.html +.. _`boost.random` : http://boost.org/libs/random/index.html + +.. _`Boost`: http://boost.org/ +.. _`Python`: http://www.python.org +.. _`pygccxml`: ./pygccxml/pygccxml.html +.. _`pyplusplus`: ./pyplusplus/pyplusplus.html +.. _`pydsc`: ./pydsc/pydsc.html +.. _`EasyBMP`: http://easybmp.sourceforge.net/ + +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + End: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-13 06:24:34
|
Revision: 393 Author: roman_yakovenko Date: 2006-08-12 23:23:50 -0700 (Sat, 12 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=393&view=rev Log Message: ----------- renaming 'boost.python' to 'Boost.Python' Modified Paths: -------------- pygccxml_dev/docs/query_interface.rest pyplusplus_dev/docs/comparisons/compare_to.rest pyplusplus_dev/docs/comparisons/pyste.rest pyplusplus_dev/docs/definition.rest pyplusplus_dev/docs/documentation/architecture.rest pyplusplus_dev/docs/documentation/best_practices.rest pyplusplus_dev/docs/documentation/containers.rest pyplusplus_dev/docs/documentation/doc_string.rest pyplusplus_dev/docs/documentation/feedback.rest pyplusplus_dev/docs/documentation/hints.rest pyplusplus_dev/docs/documentation/how_to.rest pyplusplus_dev/docs/documentation/index.rest pyplusplus_dev/docs/documentation/inserting_code.rest pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest pyplusplus_dev/docs/documentation/tutorials/tutorials.rest pyplusplus_dev/docs/examples/boost/boost.rest pyplusplus_dev/docs/examples/easybmp/easybmp.rest pyplusplus_dev/docs/examples/examples.rest pyplusplus_dev/docs/history/history.rest pyplusplus_dev/docs/links.rest pyplusplus_dev/docs/osdc2006/presentation-talk.rest pyplusplus_dev/docs/peps/call_wrapper_policies.rest pyplusplus_dev/docs/peps/indexing_suite.rest pyplusplus_dev/docs/peps/peps_index.rest pyplusplus_dev/docs/pyplusplus.rest Modified: pygccxml_dev/docs/query_interface.rest =================================================================== --- pygccxml_dev/docs/query_interface.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pygccxml_dev/docs/query_interface.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -176,7 +176,7 @@ Return value of ``member_functions`` is not Python list or set, but instance of ``mdecl_wrapper_t`` class. This class allows you to work on all selected objects at once. I will give an example from another project - `pyplusplus`_. -In order to help `boost.python`_ to manage objects life time, all functions +In order to help `Boost.Python`_ to manage objects life time, all functions should have `call policies`_. For example: :: @@ -266,7 +266,7 @@ query method, you can take a look on API documentation or into source code. -.. _`boost.python`: http://boost.org/libs/python/doc/tutorial/doc/html/index.html +.. _`Boost.Python`: http://boost.org/libs/python/doc/tutorial/doc/html/index.html .. _`call policies`: http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies .. _`Call policies`: http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies .. _`pygccxml`: ./pygccxml.html Modified: pyplusplus_dev/docs/comparisons/compare_to.rest =================================================================== --- pyplusplus_dev/docs/comparisons/compare_to.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/comparisons/compare_to.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -8,7 +8,7 @@ Pyste ----- -`Pyste`_ is the boost.python code generator, that is not under active development +`Pyste`_ is the Boost.Python code generator, that is not under active development any more. Nevertheless, users request to compare `pyplusplus`_ and `Pyste`_. You can read `here`_ the comparison. @@ -30,7 +30,7 @@ .. _`Python-OGRE` : http://lakin.weckers.net/index_ogre_python.html -Some other links, that compare boost.python, SWIG, SIP and other tools: +Some other links, that compare Boost.Python, SWIG, SIP and other tools: * `Evaluation of Python/C++ interfacing packages`_ Modified: pyplusplus_dev/docs/comparisons/pyste.rest =================================================================== --- pyplusplus_dev/docs/comparisons/pyste.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/comparisons/pyste.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -14,9 +14,9 @@ What is `Pyste`_? ----------------- -`Pyste`_ is a `boost.python`_ code generator. The user specifies the classes and +`Pyste`_ is a `Boost.Python`_ code generator. The user specifies the classes and functions to be exported using a simple interface file, which following the -`boost.python`_'s philosophy, is simple `Python`_ code. `Pyste`_ then uses +`Boost.Python`_'s philosophy, is simple `Python`_ code. `Pyste`_ then uses `GCC-XML`_ to parse all the headers and extract the necessary information to automatically generate C++ code. @@ -24,7 +24,7 @@ Preamble -------- -If you are reading this document, I can assume that you know what `boost.python`_, +If you are reading this document, I can assume that you know what `Boost.Python`_, `Pyste`_ and `pyplusplus`_ are. This document compares `Pyste`_ and `pyplusplus`_. I am going to compare: @@ -36,7 +36,7 @@ * features list: - * supported `boost.python`_ components + * supported `Boost.Python`_ components * nice features @@ -44,7 +44,7 @@ analyzes. If you identify one, please report it. I will try to fix it, as quick as possible. In the past, I created bindings to few projects using `Pyste`_. Code, generated by `Pyste`_, was pretty good and gave me a good start both with -my projects and with `boost.python`_ library. As for me, there are 2 main +my projects and with `Boost.Python`_ library. As for me, there are 2 main problems with `Pyste`_: 1. It is time consuming operation to maintain `Pyste`_ scripts in a big, @@ -70,7 +70,7 @@ Carefully read `Pyste`_ definition - "... The user specifies the classes and functions to be exported using a simple - interface file, which following the `boost.python`_'s philosophy, is simple + interface file, which following the `Boost.Python`_'s philosophy, is simple `Python`_ code. ..." @@ -104,7 +104,7 @@ `pyplusplus`_ has 2 user interfaces: 1. GUI - small and simple graphic user interface, that does not request from - user any knowledge about `boost.python`_ or `pyplusplus`_. You can see + user any knowledge about `Boost.Python`_ or `pyplusplus`_. You can see its `screenshot`_. 2. API - object-oriented framework, that helps you to create code generator, @@ -307,7 +307,7 @@ + smart pointers of derived and base class - * class wrappers generated using `boost.python`_ wrapper class + * class wrappers generated using `Boost.Python`_ wrapper class * operator() always exposed ( this is not the case with `Pyste`_ ) @@ -404,7 +404,7 @@ difference between `Pyste`_ and `pyplusplus`_. `Pyste`_ - `Pyste`_ is `boost.python`_ code generator. + `Pyste`_ is `Boost.Python`_ code generator. `pyplusplus`_ .. include:: ../definition.rest @@ -419,7 +419,7 @@ .. _`pyplusplus` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html .. _`Pyste`: http://www.boost.org/libs/python/doc/index.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`SourceForge`: http://sourceforge.net/index.php .. _`Docutils`: http://docutils.sourceforge.net .. _`Python`: http://www.python.org Modified: pyplusplus_dev/docs/definition.rest =================================================================== --- pyplusplus_dev/docs/definition.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/definition.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -1,4 +1,4 @@ `pyplusplus`_ is an object-oriented framework for creating a code generator for -`boost.python`_ library. +`Boost.Python`_ library. -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html \ No newline at end of file +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html \ No newline at end of file Modified: pyplusplus_dev/docs/documentation/architecture.rest =================================================================== --- pyplusplus_dev/docs/documentation/architecture.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/documentation/architecture.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -141,7 +141,7 @@ Code generation engine ---------------------- -Code generation for `boost.python`_ library is a difficult process. I don't know +Code generation for `Boost.Python`_ library is a difficult process. I don't know what about you, but when I have to solve some complex task, I prefer to use `divide and conquer`_ paradigm. There are 2 different problems the code generation engine should solve: @@ -150,7 +150,7 @@ * What code should be created in order to export a declaration? - I mean what `boost.python`_ code should be generated if you want to export this + I mean what `Boost.Python`_ code should be generated if you want to export this or that declaration. Code creators is the solution to this problem. @@ -207,7 +207,7 @@ `pyplusplus`_ builds more then one ``code creator``. For example: in order to export virtual function 2 ``code creator``'s are built: -( I will reuse example from `boost.python`_ `tutorials`__.) +( I will reuse example from `Boost.Python`_ `tutorials`__.) .. __ : http://boost.org/libs/python/doc/tutorial/doc/html/python/exposing.html#python.virtual_functions_with_default_implementations @@ -318,7 +318,7 @@ .. _`pyplusplus` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/best_practices.rest =================================================================== --- pyplusplus_dev/docs/documentation/best_practices.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/documentation/best_practices.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -71,7 +71,7 @@ ``precompiled_header`` argument could be ``None`` or string, that contains name of precompiled header file, that will be created in the directory. - `pyplusplus`_ will add to it header files from `boost.python`_ library and + `pyplusplus`_ will add to it header files from `Boost.Python`_ library and your header files. What is ``huge_classes`` argument for? ``huge_classes`` could be ``None`` or @@ -94,7 +94,7 @@ .. _`pyplusplus` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/containers.rest =================================================================== --- pyplusplus_dev/docs/documentation/containers.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/documentation/containers.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -37,7 +37,7 @@ containers. Well, actually he did much more - he implemented new framework. This framework provides support for almost all C++ containers and also an easy way to add support for custom ones. You'd better read his `post`_ to -`boost.python`_ mailing list or `documentation`_ for the new indexing suite. +`Boost.Python`_ mailing list or `documentation`_ for the new indexing suite. Now, I am sure you have next question: if this suite is soo good, why it is not @@ -57,7 +57,7 @@ ------------------------------ `pyplusplus`_ implements support for both indexing suites. More over, you can freely mix indexing suites. For example you can expose ``std::vector<int>`` using -`boost.python`_ built-in indexing suite and ``std::map< int, std::string>`` using +`Boost.Python`_ built-in indexing suite and ``std::map< int, std::string>`` using Raoul Gough's indexing suite. ----------------- @@ -189,7 +189,7 @@ .. _`pyplusplus` : ./../pyplusplus.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/doc_string.rest =================================================================== --- pyplusplus_dev/docs/documentation/doc_string.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/documentation/doc_string.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -26,7 +26,7 @@ In `pyplusplus`_ every class, that describes C++ declarations has ``documentation`` property. This property should contain valid C++ string or ``None``. -`boost.python`_ not always provides functionality, that exports documentation string. +`Boost.Python`_ not always provides functionality, that exports documentation string. In those cases, `pyplusplus`_ will not generate documentation string. Also the previous method is pretty clear, it is not practical. There should be a @@ -62,7 +62,7 @@ .. _`doxygen` : http://www.stack.nl/~dimitri/doxygen/ .. _`documentation string` : http://docs.python.org/tut/node6.html#SECTION006760000000000000000 .. _`pyplusplus` : ./../pyplusplus.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/feedback.rest =================================================================== --- pyplusplus_dev/docs/documentation/feedback.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/documentation/feedback.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -10,12 +10,12 @@ `pyplusplus`_ has been created with few goals in mind: -* to allow users create `Python`_ bindings for large projects using the `boost.python`_ +* to allow users create `Python`_ bindings for large projects using the `Boost.Python`_ library * to minimize maintenance time -* to serve as a user's guide for `boost.python`_ library +* to serve as a user's guide for `Boost.Python`_ library Those goals all have something in common. In order to achive them, `pyplusplus`_ must @@ -156,7 +156,7 @@ .. _`logging` : http://docs.python.org/lib/module-logging.html .. _`pyplusplus` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/hints.rest =================================================================== --- pyplusplus_dev/docs/documentation/hints.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/documentation/hints.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -39,7 +39,7 @@ property ``aliases`` you can get access to all ``typedef``'s of the class. .. _`pyplusplus` : ./../pyplusplus.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/how_to.rest =================================================================== --- pyplusplus_dev/docs/documentation/how_to.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/documentation/how_to.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -247,7 +247,7 @@ .. _`pyplusplus` : ./../pyplusplus.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/index.rest =================================================================== --- pyplusplus_dev/docs/documentation/index.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/documentation/index.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -27,7 +27,7 @@ .. _`Epydoc` : http://epydoc.sourceforge.net/ .. _`pyplusplus` : ./../pyplusplus.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/inserting_code.rest =================================================================== --- pyplusplus_dev/docs/documentation/inserting_code.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/documentation/inserting_code.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -16,7 +16,7 @@ Insert code to module --------------------- -Almost every ``boost.python`` module has next structure: +Almost every ``Boost.Python`` module has next structure: :: @@ -195,7 +195,7 @@ .. _`pyplusplus` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -153,7 +153,7 @@ .. _`pyplusplus` : ./../../../pyplusplus.html .. _`pygccxml` : ./../../../../pygccxml/pygccxml.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`SourceForge`: http://sourceforge.net/index.php .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/documentation/tutorials/tutorials.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/tutorials.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/documentation/tutorials/tutorials.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -20,10 +20,10 @@ My advise to you - start with `graphical interface`_, because: * you don't have to learn new API - * few clicks with mouse and you have `boost.python`_ code for your file(s) + * few clicks with mouse and you have `Boost.Python`_ code for your file(s) * it is very easy to evaluate `pyplusplus`_ using it * you can check whether `GCC-XML`_ is able to compile your code or not - * you can use it as a guide to `boost.python`_ library + * you can use it as a guide to `Boost.Python`_ library * it is able to generate `pyplusplus`_ code for you .. _`graphical interface` : ./pyplusplus_demo.png @@ -50,7 +50,7 @@ .. _`pyplusplus` : ./../../pyplusplus.html .. _`pygccxml` : ./../....//pygccxml/pygccxml.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`SourceForge`: http://sourceforge.net/index.php .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/examples/boost/boost.rest =================================================================== --- pyplusplus_dev/docs/examples/boost/boost.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/examples/boost/boost.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -298,7 +298,7 @@ .. _`date_time`: http://boost.org/doc/html/date_time.html .. _`boost`: http://www.boost.org .. _`Boost`: http://www.boost.org -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`boost.operators`: http://www.boost.org/ .. _`GCC-XML`: http://www.gccxml.org .. _`pyplusplus` : ./../../pyplusplus.html Modified: pyplusplus_dev/docs/examples/easybmp/easybmp.rest =================================================================== --- pyplusplus_dev/docs/examples/easybmp/easybmp.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/examples/easybmp/easybmp.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -34,7 +34,7 @@ 1. environment.py - contains different environment settings 2. generate_code.py - contains source code needed to generate - `boost.python`_ bindings for `EasyBMP`_ library. + `Boost.Python`_ bindings for `EasyBMP`_ library. 3. sconstruct - build configuration file @@ -76,7 +76,7 @@ .. _`Python`: http://www.python.org .. _`pygccxml`: http://www.language-binding.net/pygccxml/pygccxml.html .. _`EasyBMP`: http://easybmp.sourceforge.net/ -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. Local Variables: Modified: pyplusplus_dev/docs/examples/examples.rest =================================================================== --- pyplusplus_dev/docs/examples/examples.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/examples/examples.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -50,7 +50,7 @@ .. _`boost.random` : http://boost.org/libs/random/index.html .. _`GUI`: ./../tutorials/pyplusplus_demo.png -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`pyplusplus` : ./../pyplusplus.html .. _`EasyBMP`: http://easybmp.sourceforge.net/ Modified: pyplusplus_dev/docs/history/history.rest =================================================================== --- pyplusplus_dev/docs/history/history.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/history/history.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -33,7 +33,7 @@ * user messages are clear -3. Support for boost.python indexing suite version 2 was implemented. +3. Support for Boost.Python indexing suite version 2 was implemented. 4. Every code creator class took ``parent`` argument in ``__init__`` method. This argument was removed. ``adopt_creator`` and ``remove_creator`` will Modified: pyplusplus_dev/docs/links.rest =================================================================== --- pyplusplus_dev/docs/links.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/links.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -30,7 +30,7 @@ the result using a tool that `understands` the syntax and semantics of both the underlying language and the library. ..." - `pyplusplus`_ + boost.python is a SELL! + `pyplusplus`_ + Boost.Python is a SELL! * `Aspect oriented programming`_ @@ -48,11 +48,11 @@ * http://boost.org/libs/python/doc/index.html - tutorials, FAQs, reference manuals -* `boost.python wiki`_ +* `Boost.Python wiki`_ - .. _`boost.python wiki` : http://wiki.python.org/moin/boost%2epython?action=show&redirect=boost+2epython + .. _`Boost.Python wiki` : http://wiki.python.org/moin/boost%2epython?action=show&redirect=boost+2epython -* http://boost.cvs.sourceforge.net/boost/boost/libs/python/test/ - `boost.python`_ +* http://boost.cvs.sourceforge.net/boost/boost/libs/python/test/ - `Boost.Python`_ unit tests. They could be very, very helpful. * http://svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/unittests/ - `pyplusplus`_ @@ -70,7 +70,7 @@ .. _`pyplusplus mailing list` : http://sourceforge.net/mail/?group_id=118209 -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`pyplusplus` : ./pyplusplus.html .. Modified: pyplusplus_dev/docs/osdc2006/presentation-talk.rest =================================================================== --- pyplusplus_dev/docs/osdc2006/presentation-talk.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/osdc2006/presentation-talk.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -57,7 +57,7 @@ * SIP - PyQt, PyKDE ( extending only ) * Robin - ? * pyplusplus - an object-oriented framework for creating a code generator for - boost.python library. ( TnFOX, boost.date_time ) + Boost.Python library. ( TnFOX, boost.date_time ) Libraries: Modified: pyplusplus_dev/docs/peps/call_wrapper_policies.rest =================================================================== --- pyplusplus_dev/docs/peps/call_wrapper_policies.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/peps/call_wrapper_policies.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -73,7 +73,7 @@ Call policies ------------- I don't have any solution to the next problem. -I am going to change a little an example, from `boost.python`_ tutorials: +I am going to change a little an example, from `Boost.Python`_ tutorials: http://www.boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies :: @@ -90,7 +90,7 @@ return y.x; } - //boost.python code + //Boost.Python code def("f", f, return_internal_reference<1, with_custodian_and_ward<1, 2> >() ); What is the difference? Function ``f`` now takes 3rd argument - ``int&``. This @@ -101,7 +101,7 @@ I see only one solution user have to change signature of function ``f``. Now some speculations: -1. May be it is possible with `boost.python`_ library to set call policies on the +1. May be it is possible with `Boost.Python`_ library to set call policies on the part of the return value? :: @@ -113,7 +113,7 @@ def("f", f_wrapper, smart call policies that will work only on first element within the tuple ); -2. May be it is possible to create boost.python ``object`` with life-time management +2. May be it is possible to create Boost.Python ``object`` with life-time management hint? :: @@ -124,7 +124,7 @@ return boost::python::make_tuple( x_obj, error ); } -Anyway, I think we will just ignore the problem - software ( == boost.python ) +Anyway, I think we will just ignore the problem - software ( == Boost.Python ) should not be perfect - it should work in most ( != all ) cases! ------------ @@ -232,7 +232,7 @@ ------- It still not clear to me how it should be implemented. There are also some issues -with `boost.python`_ library before we can implement some policies. +with `Boost.Python`_ library before we can implement some policies. If you can help or have some nice idea, please share: https://lists.sourceforge.net/lists/listinfo/pygccxml-development @@ -240,7 +240,7 @@ .. _`pyplusplus` : ./../pyplusplus.html .. |cwp| replace:: *"call wrapper policies"* -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/peps/indexing_suite.rest =================================================================== --- pyplusplus_dev/docs/peps/indexing_suite.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/peps/indexing_suite.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -52,7 +52,7 @@ classes should be exported too. 3. It will understand that those classes should be exported using indexing suite - functionality provided by `boost.python`_ library or `pyplusplus`_ + functionality provided by `Boost.Python`_ library or `pyplusplus`_ ``code repository``. 4. It will generate the code, that will use that functionality. @@ -85,7 +85,7 @@ .. _`pyplusplus` : ./../pyplusplus.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/peps/peps_index.rest =================================================================== --- pyplusplus_dev/docs/peps/peps_index.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/peps/peps_index.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -56,7 +56,7 @@ .. __ : ./indexing_suite.html .. _`pyplusplus` : ./../pyplusplus.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/docs/pyplusplus.rest =================================================================== --- pyplusplus_dev/docs/pyplusplus.rest 2006-08-12 19:24:28 UTC (rev 392) +++ pyplusplus_dev/docs/pyplusplus.rest 2006-08-13 06:23:50 UTC (rev 393) @@ -22,7 +22,7 @@ Code generation process ----------------------- -`boost.python`_ library allows you to expose C++ code to `Python`_ in quick and +`Boost.Python`_ library allows you to expose C++ code to `Python`_ in quick and elegant way. Almost the whole process of exposing declarations can be automated by use of pyplusplus. Code generation process, using pyplusplus consists from few steps. Next paragraphs will tell you more about every step. @@ -188,7 +188,7 @@ .. _`pyplusplus` : ./pyplusplus.html .. _`pygccxml` : ./../pygccxml/pygccxml.html -.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org .. _`Boost Software License`: http://boost.org/more/license_info.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-08-12 19:24:39
|
Revision: 392 Author: roman_yakovenko Date: 2006-08-12 12:24:28 -0700 (Sat, 12 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=392&view=rev Log Message: ----------- updating docs Modified Paths: -------------- pyplusplus_dev/docs/comparisons/www_configuration.py pyplusplus_dev/docs/documentation/architecture.rest Added Paths: ----------- pyplusplus_dev/docs/comparisons/compare_to.rest Added: pyplusplus_dev/docs/comparisons/compare_to.rest =================================================================== --- pyplusplus_dev/docs/comparisons/compare_to.rest (rev 0) +++ pyplusplus_dev/docs/comparisons/compare_to.rest 2006-08-12 19:24:28 UTC (rev 392) @@ -0,0 +1,55 @@ +========================= +Compare pyplusplus to ... +========================= + +.. contents:: Table of contents + +----- +Pyste +----- + +`Pyste`_ is the boost.python code generator, that is not under active development +any more. Nevertheless, users request to compare `pyplusplus`_ and `Pyste`_. You +can read `here`_ the comparison. + +.. _`here` : ./Pyste.html + +---------- +SWIG & SIP +---------- + +The document, that compares SIP, SWIG and `pyplusplus`_ is under construction. +May be you are editing it right now, by evaluating these tools :-). I did not use +SWIG and SIP, so I can not provide you with fair comparison. I will let the open +source project(s) "to talk": + +* `Python-OGRE`_: + + The impression of Lakin Wecker, after spending 30 hours working working with + `pyplusplus`_: http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=1478&sid=4d77585146aabbc54f4b31ec50874d86 + + .. _`Python-OGRE` : http://lakin.weckers.net/index_ogre_python.html + +Some other links, that compare boost.python, SWIG, SIP and other tools: + +* `Evaluation of Python/C++ interfacing packages`_ + + .. _`Evaluation of Python/C++ interfacing packages` : http://seal.web.cern.ch/seal/work-packages/scripting/evaluation-report.html + +* `Integrating Python, C and C++`_ + + .. _`Integrating Python, C and C++` : http://www.suttoncourtenay.org.uk/duncan/accu/integratingpython.html + + + +.. _`pyplusplus` : ./../pyplusplus.html +.. _`Pyste`: http://www.boost.org/libs/python/doc/index.html + + +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + End: Modified: pyplusplus_dev/docs/comparisons/www_configuration.py =================================================================== --- pyplusplus_dev/docs/comparisons/www_configuration.py 2006-08-10 14:25:39 UTC (rev 391) +++ pyplusplus_dev/docs/comparisons/www_configuration.py 2006-08-12 19:24:28 UTC (rev 392) @@ -1,2 +1,5 @@ name = 'compare to ...' -main_html_file = 'pyste.html' \ No newline at end of file +main_html_file = 'compare_to.html' +names = { 'compare_to' : 'compare to ...' + , 'pyste' : 'Pyste' +} \ No newline at end of file Modified: pyplusplus_dev/docs/documentation/architecture.rest =================================================================== --- pyplusplus_dev/docs/documentation/architecture.rest 2006-08-10 14:25:39 UTC (rev 391) +++ pyplusplus_dev/docs/documentation/architecture.rest 2006-08-12 19:24:28 UTC (rev 392) @@ -23,22 +23,19 @@ On the earlier stage of the development, I realized, that all this functionality does not belong to code generator and should be implemented out side of it. `pygccxml`_ project was born. `pygccxml`_ made the code generator to be smaller -and C++ parser independent. - -`pygccxml`_ provides next services: +and C++ parser independent. It provides next services: -* definition of classes, that describe C++ declaration and types +* definition of classes, that describe C++ declaration and types, and their + analizers ( type traits ) -* C++ declaration and type analizers( type traits ) - * C++ source files parsing and caching functionality `pyplusplus`_ uses those services to: -* extract declarations from source files +* extract declarations from source files and to provide powerful query interface -* find out declaration default configuration: +* find out a declaration default configuration: * call policies for functions @@ -48,26 +45,22 @@ * ... -* provide powerful query interface - pyplusplus & pygccxml integration --------------------------------- -In general `pygccxml`_ provides two main services "parsing" and "declarations tree". -`pyplusplus`_ uses different approaches to exposes those services to the user. +`pyplusplus`_ uses different approaches to expose these services to the user. Parsing integration ------------------- -`pyplusplus`_ provides it's own API to configure and run `pygccxml`_ parsing +`pyplusplus`_ provides it's own "API" to configure and run `pygccxml`_ parsing services. The "API" I am talking about, is arguments to ``module_builder.__init__`` -method. This method takes all arguments needed to envoke "parsing" services. -This has been done to simplify usage of `pyplusplus`_. +method. This method takes all arguments needed to envoke parsing services. This +has been done to simplify the usage of `pyplusplus`_. Declarations tree integration ----------------------------- - Declarations tree API consists from 3 parts: * interface definition: @@ -81,11 +74,12 @@ * query engine API -The user should be familiar with those part and relevant API. You may ask "why"? -The answer is simple: in my opinion, wrapping/hidding/modifying the API will not -give any value. +The user should be familiar with these part and relevant API of `pygccxml`_ project. +The reason is simple: in my opinion, wrapping/hidding/modifying the API will not +provide an additonal value. The interface of all those services is pretty simple +and well polished. -The question you should ask is: how is this API integrated? Before I start to +The question you should ask now is: how is this API integrated? Before I start to explain, lets take a look on next source code: :: @@ -106,22 +100,23 @@ What you see here, is a common pattern, that will appear in all projects, that use `pyplusplus`_: -* find declaration(s) +* find the declaration(s) -* give instruction(s) to code generator engine +* give the instruction(s) to the code generator engine What is the point of this example? From the user point of view it is perfectly -good, it makes a lot of sence to configure the engine, using declarations tree. -Now, the desired solution is clear: we should use declarations tree to configure -the engine. So, lets re-formulate the question: how does `pyplusplus`_ add missinig -functionality to ``pygccxml.declarations`` classes? There were few possible -solutions to the problem. The next one was implemented: +good, it makes a lot of sence to configure the code generation engine, using +the declarations tree. Now, the desired solution is clear: we should use +declarations tree to configure the engine. So, let me to re-formulate the +question: how does `pyplusplus`_ add missinig functionality to +``pygccxml.declarations`` classes? There were few possible solutions to the +problem. The next one was implemented: 1. ``pygccxml.parser`` package interface was extendent. Instead of creating - a concrete instance of declaration class , ``pygccxml.parser`` package uses + a concrete instance of declaration classes, ``pygccxml.parser`` package uses factory. -2. ``pyplusplus.decl_wrappers`` package defines classes, that derives from +2. ``pyplusplus.decl_wrappers`` package defines classes, that derive from ``pygccxml.declarations`` classes and defines the factory. Also, this solution is not the simplest one, it provides an additional value to @@ -135,7 +130,7 @@ * classes defined in ``pyplusplus.decl_wrappers`` package implement next functionality: - * setting reasonable defaults for code generation engine( call policies, + * setting reasonable defaults for the code generation engine( call policies, indexing suite, ... ) * provides user with additional information( warnings and hints ) @@ -148,7 +143,7 @@ Code generation for `boost.python`_ library is a difficult process. I don't know what about you, but when I have to solve some complex task, I prefer to use -`divide and conquer`_ paradigm. There are 2 different problems code generation +`divide and conquer`_ paradigm. There are 2 different problems the code generation engine should solve: .. _`divide and conquer` : http://en.wikipedia.org/wiki/Divide_and_conquer_algorithm @@ -185,7 +180,7 @@ * function could be overloaded -As you see, there are a lot of use cases. How does ``code creator`` solves the +As you see, there are a lot of use cases. How does ``code creator``'s solve the problem? There is almost a direct mapping between ``code creator``'s and use cases. ``Code creator`` knows what code should be generated, in order to export a declaration. That is the only job of ``code creator``. For example: @@ -220,10 +215,13 @@ 2. ``f`` registration code - ``code_creators.mem_fun_v_t`` + Reminder: classes, defined in ``pyplusplus.decl_wrappers`` package, are used as configuration to ``code creator``. So, ``code creator`` keeps reference to declaration and when it is requested to generate code, it does this according to the declaration configuration. + +``Code creator``'s are the only classes, that generate the code! Now when you understand, what ``code creator`` is, it is a time to move on - composite code creator. Composite ``code creator`` is a creator, that contains @@ -247,16 +245,77 @@ result.append( compound.compound_t.create_internal_code( self.creators ) ) result.append( "}" ) return os.linesep.join( result ) + + +Code creators tree +~~~~~~~~~~~~~~~~~~ + +``code_creators.module_t`` code creator is a top level code creator. It is a +composite ``code creator`` too. Take a look on next possible "snapshot" of the +code creators structure: + +:: + + <module_t ...> + <license_t ...> + <include_t ...> + <include_t ...> + <class_wrapper_t ...> + <mem_fun_v_wrapper_t ...> + <mem_fun_v_wrapper_t ...> + <module_body_t ...> + <enum_t ...> + <class_t ...> + <mem_fun_v_t ...> + <member_variable_t ...> + <free_function_t ...> + <...> -Sometimes, I will use termine ``code creators tree``. What is it? There is top -level ``code creator`` - ``code_creators.module_t``. It keeps reference to -other ``code creator``'s. It is also composite ``code creator``. All -``code creator``'s organized in a tree structure. +I hope, now you understand the termine ``code creators tree``. + +Code creators tree construction +------------------------------- + +``pygccxml.declarations`` package defines declarations visitor class. +``pyplusplus.module_creator.creator_t`` class derives from this class. Its main +job is to create ``code creators tree``. You can think about this class as a +big "switch-case" statement. This is the only class that fully "understands" +declarations and ``code creators``. It reads a declaration and then constructs +one or more ``code creator``'s and put them into the tree. + +There is one interesting thing about this class you should know: this is the only +class that "sees" all declarations. It monitors all exported functions and +variables. Thus it knows that class ``X`` is used with ``boost::shared_ptr``, +so it will set ``class_`` ``HeldType`` to be ``boost::shared_ptr`` or will register +the usage of it. Another interesting example is std containers. You don't have +to say to `pyplusplus`_ to export them, it will do it by itself. You may ask +why this detail is interesting? Because the user does not have to specify all +set of declarations he wants to export! Because, it is possible to implement +( and we will be implemented ) next feature. `pyplusplus`_ will generate warning +if an user exports functon ``f``, that uses non-exported class ``Y``. +``pyplusplus.module_creator.types_database_t`` will have this functionality. + + + +File writers +------------ + +``File writer``'s classes is responcible for writting `code creators tree`` into +files. `pyplusplus`_ was built to deal with big projects, nevetherless it handles +small projects very well too. Do you want to see how ``file_writers.single_file_t`` +code looks that writes created code to file? + +:: + + ... + #write_file will write the code to file only if needed. + #extmodule is an instance of code_creators.module_t class + self.write_file( self.file_name, self.extmodule.create() ) + + - - .. _`pyplusplus` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html .. _`boost.python`: http://www.boost.org/libs/python/doc/index.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |