[pygccxml-commit] SF.net SVN: pygccxml:[1553] pyplusplus_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2009-01-10 21:09:03
|
Revision: 1553 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1553&view=rev Author: roman_yakovenko Date: 2009-01-10 21:08:55 +0000 (Sat, 10 Jan 2009) Log Message: ----------- adding gmp example Modified Paths: -------------- pygccxml_dev/pygccxml/binary_parsers/parsers.py pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py pyplusplus_dev/pyplusplus/code_creators/library_reference.py pyplusplus_dev/pyplusplus/creators_factory/ctypes_creator.py Added Paths: ----------- pyplusplus_dev/examples/environment.py pyplusplus_dev/examples/gmplib_dev/ pyplusplus_dev/examples/gmplib_dev/dev/ Modified: pygccxml_dev/pygccxml/binary_parsers/parsers.py =================================================================== --- pygccxml_dev/pygccxml/binary_parsers/parsers.py 2009-01-08 21:16:13 UTC (rev 1552) +++ pygccxml_dev/pygccxml/binary_parsers/parsers.py 2009-01-10 21:08:55 UTC (rev 1553) @@ -290,7 +290,7 @@ parser = dll_file_parser_t( global_ns, fname ) elif '.map' == ext: parser = map_file_parser_t( global_ns, fname ) - elif '.so' == ext: + elif '.so' == ext or '.so.' in os.path.basename(fname): parser = so_file_parser_t( global_ns, fname ) else: raise RuntimeError( "Don't know how to read exported symbols from file '%s'" Added: pyplusplus_dev/examples/environment.py =================================================================== --- pyplusplus_dev/examples/environment.py (rev 0) +++ pyplusplus_dev/examples/environment.py 2009-01-10 21:08:55 UTC (rev 1553) @@ -0,0 +1,24 @@ +#! /usr/bin/python +# Copyright 2004-2008 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import os +import sys + +this_module_dir_path = os.path.abspath ( os.path.dirname( sys.modules[__name__].__file__) ) +project_root = os.path.abspath( os.path.join( this_module_dir_path, '..','..' ) ) +complete_path = lambda *args: os.path.join( project_root, *args ) + +class settings: + pygccxml_path = complete_path( 'pygccxml_dev' ) + pyplusplus_path = complete_path( 'pyplusplus_dev' ) + gccxml_path = complete_path( 'gccxml_bin', 'v09', sys.platform, 'bin' ) + + @staticmethod + def setup_environment(): + sys.path.append( settings.pygccxml_path ) + sys.path.append( settings.pyplusplus_path ) + +settings.setup_environment() Modified: pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py 2009-01-08 21:16:13 UTC (rev 1552) +++ pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py 2009-01-10 21:08:55 UTC (rev 1553) @@ -118,8 +118,8 @@ return "( %s * %d )" % ( item_type, size ) def visit_free_function_type( self ): - return_visitor = type_converter_t( self.return_type, self.decl_formatter ) - return_type = declarations.apply_visitor(return_visitor, self.return_type) + return_visitor = type_converter_t( self.user_type.return_type, self.decl_formatter ) + return_type = declarations.apply_visitor(return_visitor, self.user_type.return_type) argtypes = [] for arg in self.user_type.arguments_types: arg_visitor = type_converter_t( arg, self.decl_formatter ) Modified: pyplusplus_dev/pyplusplus/code_creators/library_reference.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/library_reference.py 2009-01-08 21:16:13 UTC (rev 1552) +++ pyplusplus_dev/pyplusplus/code_creators/library_reference.py 2009-01-10 21:08:55 UTC (rev 1553) @@ -42,7 +42,7 @@ def _create_impl(self): return '%(var)s = ctypes.%(loader)s( r"%(path)s" )' \ % dict( var=self.library_var_name - , loader=self.iif( self._is_cpp_library, 'CPPDLL', 'CDLL' ) + , loader='CDLL' , path=self._library_path ) def _get_system_headers_impl( self ): Modified: pyplusplus_dev/pyplusplus/creators_factory/ctypes_creator.py =================================================================== --- pyplusplus_dev/pyplusplus/creators_factory/ctypes_creator.py 2009-01-08 21:16:13 UTC (rev 1552) +++ pyplusplus_dev/pyplusplus/creators_factory/ctypes_creator.py 2009-01-10 21:08:55 UTC (rev 1553) @@ -102,6 +102,8 @@ # - implement better 0(n) algorithm def __add_class_introductions( self, cc, class_ ): + if not self.__should_generate_code( class_ ): + return ci_creator = code_creators.class_introduction_t( class_ ) self.__class2introduction[ class_ ] = ci_creator cc.adopt_creator( ci_creator ) @@ -232,9 +234,10 @@ self.__dependencies_manager.add_exported( self.curr_decl ) #fields definition should be recursive using the visitor self.__class_defs_ccs.adopt_creator( code_creators.fields_definition_t( self.curr_decl ) ) - md_cc = code_creators.methods_definition_t( self.curr_decl ) - self.__class2methods_def[ self.curr_decl ] = md_cc - self.__class_defs_ccs.adopt_creator( md_cc ) + if self.curr_decl.calldefs( self.__should_generate_code, recursive=False, allow_empty=True ): + md_cc = code_creators.methods_definition_t( self.curr_decl ) + self.__class2methods_def[ self.curr_decl ] = md_cc + self.__class_defs_ccs.adopt_creator( md_cc ) class_ = self.curr_decl for decl in self.curr_decl.decls( recursive=False, allow_empty=True ): if self.__should_generate_code( decl ): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |