[pygccxml-commit] SF.net SVN: pygccxml: [291] pyplusplus_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-07-11 07:25:48
|
Revision: 291 Author: roman_yakovenko Date: 2006-07-11 00:24:56 -0700 (Tue, 11 Jul 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=291&view=rev Log Message: ----------- adding different loggers for different functionality fixing some bug in generated code for member function, that belongs to template instantiated class Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/cpptypes.py pygccxml_dev/pygccxml/parser/source_reader.py pygccxml_dev/pygccxml/utils/__init__.py pyplusplus_dev/examples/pyboost_dev/dev/boost_random/generate_code.py pyplusplus_dev/examples/pyboost_dev/dev/crc/generate_code.py pyplusplus_dev/examples/pyboost_dev/dev/date_time/generate_code.py pyplusplus_dev/examples/pyboost_dev/dev/rational/generate_code.py pyplusplus_dev/pyplusplus/_logging_/__init__.py pyplusplus_dev/pyplusplus/code_creators/calldef.py pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py pyplusplus_dev/pyplusplus/file_writers/multiple_files.py pyplusplus_dev/pyplusplus/file_writers/writer.py pyplusplus_dev/pyplusplus/module_builder/builder.py pyplusplus_dev/pyplusplus/module_creator/types_database.py pyplusplus_dev/unittests/test_all.py Added Paths: ----------- pyplusplus_dev/unittests/data/unnamed_classes_to_be_exported.hpp pyplusplus_dev/unittests/unnamed_classes_tester.py Modified: pygccxml_dev/pygccxml/declarations/cpptypes.py =================================================================== --- pygccxml_dev/pygccxml/declarations/cpptypes.py 2006-07-10 19:12:24 UTC (rev 290) +++ pygccxml_dev/pygccxml/declarations/cpptypes.py 2006-07-11 07:24:56 UTC (rev 291) @@ -406,7 +406,8 @@ , [ arg.clone() for arg in self.arguments_types ] ) #TODO: create real typedef - def create_typedef( self, typedef_name): + def create_typedef( self, typedef_name, unused=None): + #unused argument simplifies user code return free_function_type_t.TYPEDEF_NAME_TEMPLATE % { 'typedef_name' : typedef_name , 'return_type' : self.return_type.decl_string @@ -438,7 +439,7 @@ ,doc="reference to parent L{class<declaration_t>}" ) #TODO: create real typedef - def create_typedef( self, typedef_name): + def create_typedef( self, typedef_name, class_alias=None): """ creates typedef to the function type @@ -447,11 +448,13 @@ """ has_const_str = '' if self.has_const: - has_const_str = 'const' + has_const_str = 'const' + if None is class_alias: + class_alias = self.class_inst.decl_string return member_function_type_t.TYPEDEF_NAME_TEMPLATE % { 'typedef_name' : typedef_name , 'return_type' : self.return_type.decl_string - , 'class' : self.class_inst.decl_string + , 'class' : class_alias , 'arguments' : ','.join( map( lambda x: x.decl_string, self.arguments_types ) ) , 'has_const' : has_const_str } Modified: pygccxml_dev/pygccxml/parser/source_reader.py =================================================================== --- pygccxml_dev/pygccxml/parser/source_reader.py 2006-07-10 19:12:24 UTC (rev 290) +++ pygccxml_dev/pygccxml/parser/source_reader.py 2006-07-11 07:24:56 UTC (rev 291) @@ -1,335 +1,335 @@ -# Copyright 2004 Roman Yakovenko. -# Distributed under the Boost Software License, Version 1.0. (See -# accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -import os -import sys -import config -import pygccxml.utils -import linker -import scanner -import declarations_cache -import patcher -from pygccxml.declarations import * -from pygccxml import utils - -class gccxml_runtime_error_t( RuntimeError ): - def __init__( self, msg ): - RuntimeError.__init__( self, msg ) - - -def bind_aliases( decls ): - """ - This function binds between class and it's typedefs. - - @param decls: list of all declarations - @type all_classes: list of L{declaration_t} items - - @return: None - """ - visited = set() - for decl in decls: - if not isinstance( decl, typedef_t ): - continue - type_ = remove_alias( decl.type ) - if not isinstance( type_, declarated_t ): - continue - cls_inst = type_.declaration - if not isinstance( cls_inst, class_t ): - continue - if id( cls_inst ) not in visited: - visited.add( id( cls_inst ) ) - del cls_inst.aliases[:] - cls_inst.aliases.append( decl ) - -class source_reader_t: - """ - This class reads C++ source code and returns declarations tree. - - This class is the only class that have an intime 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. L{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. L{linker_t} - this class contains logic for replacing GCC-XML generated - ids with references to declarations or type class instances. - """ - def __init__( self, config, cache=None, decl_factory=None ): - """ - @param config: instance of L{config_t} class, that contains GCC-XML - configuration - @type config: L{config_t} - - @param cache: reference to cache object, that will be updated after - file has been parsed. - @param cache: instance of class, that derives from {cache_base_t} - - @param decl_factory: declarations factory, if not given default - declarations factory L{decl_factory_t} will be used +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import os +import sys +import config +import pygccxml.utils +import linker +import scanner +import declarations_cache +import patcher +from pygccxml.declarations import * +from pygccxml import utils + +class gccxml_runtime_error_t( RuntimeError ): + def __init__( self, msg ): + RuntimeError.__init__( self, msg ) + + +def bind_aliases( decls ): + """ + This function binds between class and it's typedefs. + + @param decls: list of all declarations + @type all_classes: list of L{declaration_t} items + + @return: None + """ + visited = set() + for decl in decls: + if not isinstance( decl, typedef_t ): + continue + type_ = remove_alias( decl.type ) + if not isinstance( type_, declarated_t ): + continue + cls_inst = type_.declaration + if not isinstance( cls_inst, class_t ): + continue + if id( cls_inst ) not in visited: + visited.add( id( cls_inst ) ) + del cls_inst.aliases[:] + cls_inst.aliases.append( decl ) + +class source_reader_t: + """ + This class reads C++ source code and returns declarations tree. + + This class is the only class that have an intime 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. L{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. L{linker_t} - this class contains logic for replacing GCC-XML generated + ids with references to declarations or type class instances. + """ + def __init__( self, config, cache=None, decl_factory=None ): """ - self.logger = utils.loggers.gccxml - self.__search_directories = [] - self.__config = config - self.__search_directories.append( config.working_directory ) - self.__search_directories.extend( config.include_paths ) - if not cache: - cache = declarations_cache.dummy_cache_t() - self.__dcache = cache - self.__raise_on_wrong_settings() - self.__decl_factory = decl_factory - if not decl_factory: - self.__decl_factory = decl_factory_t() - - def __raise_on_wrong_settings(self): - if not os.path.isfile( self.__config.gccxml_path ): - if sys.platform == 'win32': - gccxml_name = 'gccxml' + '.exe' - environment_var_delimiter = ';' - elif sys.platform == 'linux2' or sys.platform == 'darwin': - gccxml_name = 'gccxml' - environment_var_delimiter = ':' - else: - raise RuntimeError( 'unable to find out location of gccxml' ) - may_be_gccxml = os.path.join( self.__config.gccxml_path, gccxml_name ) - if os.path.isfile( may_be_gccxml ): - self.__config.gccxml_path = may_be_gccxml - else: - for path in os.environ['PATH'].split( environment_var_delimiter ): - gccxml_path = os.path.join( path, gccxml_name ) - if os.path.isfile( gccxml_path ): - self.__config.gccxml_path = gccxml_path - break - else: - msg = 'gccxml_path("%s") should exists or to be a valid file name.' \ - % self.__config.gccxml_path - raise RuntimeError( msg ) - if not os.path.isdir( self.__config.working_directory ): - msg = 'working_directory("%s") should exists or to be a valid directory name.' \ - % self.__config.working_directory - raise RuntimeError( msg ) - for include_path in self.__config.include_paths: - if not os.path.isdir( include_path ): - msg = 'include path "%s" should exists or to be a valid directory name.' \ - % include_path - raise RuntimeError( msg ) - - def __create_command_line(self, file, xmlfile): - assert isinstance( self.__config, config.config_t ) - #returns - cmd = [] - #first is gccxml executable - if 'win32' in sys.platform: - cmd.append( '"%s"' % os.path.normpath( self.__config.gccxml_path ) ) - else: - cmd.append( '%s' % os.path.normpath( self.__config.gccxml_path ) ) - # Add all cflags passed - if self.__config.cflags != "": - cmd.append(" %s "%self.__config.cflags) - #second all additional includes directories - cmd.append( ''.join( [' -I"%s"' % search_dir for search_dir in self.__search_directories] ) ) - #third all additional defined symbols - cmd.append( ''.join( [' -D"%s"' % defined_symbol for defined_symbol in self.__config.define_symbols] ) ) - cmd.append( ''.join( [' -U"%s"' % undefined_symbol for undefined_symbol in self.__config.undefine_symbols] ) ) - #fourth source file - cmd.append( '"%s"' % file ) - #five destination file - cmd.append( '-fxml="%s"' % xmlfile ) - if self.__config.start_with_declarations: - cmd.append( '-fxml-start="%s"' % ','.join( self.__config.start_with_declarations ) ) - - cmd_line = ' '.join(cmd) - if 'win32' in sys.platform : - cmd_line = '"%s"' % cmd_line - self.logger.info( 'gccxml cmd: %s' % cmd_line ) - return cmd_line - - def create_xml_file( self, header, destination=None ): - """ - This function will return the file name of the file, created by GCC-XML - for "header" file. If destination_file_path is not None, then this file - path will be used and returned. - - @param header: path to source file, that should be parsed - @type header: str - - @param destination: if given, will be used as target file/path for - GCC-XML generated file. - @type destination: str - - @return: path to GCC-XML generated file - """ - gccxml_file = destination - # If file specified, remove it to start else create new file name - if gccxml_file: - pygccxml.utils.remove_file_no_raise( gccxml_file ) - else: - gccxml_file = pygccxml.utils.create_temp_file_name( suffix='.xml' ) - try: - ffname = header - if not os.path.isabs( ffname ): - ffname = self.__file_full_name(header) - command_line = self.__create_command_line( ffname, gccxml_file ) - input_, output = os.popen4( command_line ) - input_.close() - gccxml_reports = [] - while True: - data = output.readline() - gccxml_reports.append( data ) - if not data: - break - exit_status = output.close() - gccxml_msg = ''.join(gccxml_reports) - if self.__config.ignore_gccxml_output: - if not os.path.isfile(gccxml_file): - raise gccxml_runtime_error_t( "Error occured while running GCC-XML: %s status:%s" % (gccxml_msg, exit_status) ) - else: - if gccxml_msg or exit_status or not os.path.isfile(gccxml_file): - raise gccxml_runtime_error_t( "Error occured while running GCC-XML: %s" % gccxml_msg ) - except Exception, error: - pygccxml.utils.remove_file_no_raise( gccxml_file ) - raise error - return gccxml_file - - def create_xml_file_from_string( self, content, destination=None ): - """ - Creates XML file from text. - - @param content: C++ source code - @type content: str - - @param destination: file name for GCC-XML generated file - @type destination: str - - @return: returns file name of GCC-XML generated file - """ - header_file = pygccxml.utils.create_temp_file_name( suffix='.h' ) - gccxml_file = None - try: - header_file_obj = file(header_file, 'w+') - header_file_obj.write( content ) - header_file_obj.close() - gccxml_file = self.create_xml_file( header_file, destination ) - finally: - pygccxml.utils.remove_file_no_raise( header_file ) - return gccxml_file - - def read_file(self, source_file): - """ - Reads C++ source file and returns declarations tree - - @param source_file: path to C++ source file - @type source_file: str - """ - declarations, types = None, None - gccxml_file = '' - try: - ffname = self.__file_full_name(source_file) - self.logger.debug( "Reading source file: [%s]." % ffname ) - declarations = self.__dcache.cached_value( ffname, self.__config ) - if not declarations: - self.logger.debug( "File has not been found in cache, parsing..." ) - gccxml_file = self.create_xml_file( ffname ) - declarations, files = self.__parse_gccxml_created_file( gccxml_file ) - self.__dcache.update( ffname, self.__config, declarations, files ) - else: - self.logger.debug( "File has not been changed, reading declarations from cache." ) - except Exception, error: - if gccxml_file: - pygccxml.utils.remove_file_no_raise( gccxml_file ) - raise error - if gccxml_file: - pygccxml.utils.remove_file_no_raise( gccxml_file ) - return declarations - - def read_xml_file(self, gccxml_created_file): - """ - Reads GCC-XML generated XML file. - - @param gccxml_created_file: path to GCC-XML generated file - @type gccxml_created_file: str - - @return: declarations tree - """ - self.logger.debug( "Reading xml file: [%s]" % gccxml_created_file ) - - declarations, files = self.__parse_gccxml_created_file( gccxml_created_file ) - return declarations - - def read_string(self, content): - """ - Reads Python string, that contains valid C++ code, and returns - declarations tree. - """ - header_file = pygccxml.utils.create_temp_file_name( suffix='.h' ) - header_file_obj = file(header_file, 'w+') - header_file_obj.write( content ) - header_file_obj.close() - declarations = None - try: - declarations = self.read_file( header_file ) - except Exception, error: - pygccxml.utils.remove_file_no_raise( header_file ) - raise error - pygccxml.utils.remove_file_no_raise( header_file ) - return declarations - - def __file_full_name( self, file ): - if os.path.isfile( file ): - return file - for path in self.__search_directories: - file_path = os.path.join( path, file ) - if os.path.isfile( file_path ): - return file_path - raise RuntimeError( "pygccxml error: file '%s' does not exist" % file ) - - def __produce_full_file( self, file_path ): - if os.path.isabs( file_path ): - return file_path - try: - abs_file_path = os.path.realpath( os.path.join( self.__config.working_directory, file_path ) ) - if os.path.exists( abs_file_path ): - return os.path.normpath( abs_file_path ) - return file_path - except Exception: - return file_path - - def __parse_gccxml_created_file( self, gccxml_file ): - scanner_ = scanner.scanner_t( gccxml_file, self.__decl_factory ) - scanner_.read() - decls = scanner_.declarations() - types = scanner_.types() - files = {} - for file_id, file_path in scanner_.files().items(): - files[file_id] = self.__produce_full_file(file_path) - linker_ = linker.linker_t( decls=decls - , types=types - , access=scanner_.access() - , membership=scanner_.members() - , files=files ) - for type_ in list( types.itervalues() ): - #I need this copy because internaly linker change types collection - linker_.instance = type_ - apply_visitor( linker_, type_ ) - for decl in decls.itervalues(): - linker_.instance = decl - apply_visitor( linker_, decl ) - bind_aliases( decls.itervalues() ) - decls = filter( lambda inst: isinstance(inst, declaration_t) and not inst.parent, decls.itervalues() ) - #some times gccxml report typedefs defined in no namespace - #it happens for example in next situation - #template< typename X> - #void ddd(){ typedef typename X::Y YY;} - decls = filter( lambda inst: isinstance( inst, namespace_t ), decls ) - decls = patcher.patch_it( decls ) - decls_all = make_flatten( decls ) - for decl in decls_all: - if decl.location: - decl.location.file_name = self.__produce_full_file( decl.location.file_name ) - return ( decls, files.values() ) - + @param config: instance of L{config_t} class, that contains GCC-XML + configuration + @type config: L{config_t} + + @param cache: reference to cache object, that will be updated after + file has been parsed. + @param cache: instance of class, that derives from {cache_base_t} + + @param decl_factory: declarations factory, if not given default + declarations factory L{decl_factory_t} will be used + """ + self.logger = utils.loggers.gccxml + self.__search_directories = [] + self.__config = config + self.__search_directories.append( config.working_directory ) + self.__search_directories.extend( config.include_paths ) + if not cache: + cache = declarations_cache.dummy_cache_t() + self.__dcache = cache + self.__raise_on_wrong_settings() + self.__decl_factory = decl_factory + if not decl_factory: + self.__decl_factory = decl_factory_t() + + def __raise_on_wrong_settings(self): + if not os.path.isfile( self.__config.gccxml_path ): + if sys.platform == 'win32': + gccxml_name = 'gccxml' + '.exe' + environment_var_delimiter = ';' + elif sys.platform == 'linux2' or sys.platform == 'darwin': + gccxml_name = 'gccxml' + environment_var_delimiter = ':' + else: + raise RuntimeError( 'unable to find out location of gccxml' ) + may_be_gccxml = os.path.join( self.__config.gccxml_path, gccxml_name ) + if os.path.isfile( may_be_gccxml ): + self.__config.gccxml_path = may_be_gccxml + else: + for path in os.environ['PATH'].split( environment_var_delimiter ): + gccxml_path = os.path.join( path, gccxml_name ) + if os.path.isfile( gccxml_path ): + self.__config.gccxml_path = gccxml_path + break + else: + msg = 'gccxml_path("%s") should exists or to be a valid file name.' \ + % self.__config.gccxml_path + raise RuntimeError( msg ) + if not os.path.isdir( self.__config.working_directory ): + msg = 'working_directory("%s") should exists or to be a valid directory name.' \ + % self.__config.working_directory + raise RuntimeError( msg ) + for include_path in self.__config.include_paths: + if not os.path.isdir( include_path ): + msg = 'include path "%s" should exists or to be a valid directory name.' \ + % include_path + raise RuntimeError( msg ) + + def __create_command_line(self, file, xmlfile): + assert isinstance( self.__config, config.config_t ) + #returns + cmd = [] + #first is gccxml executable + if 'win32' in sys.platform: + cmd.append( '"%s"' % os.path.normpath( self.__config.gccxml_path ) ) + else: + cmd.append( '%s' % os.path.normpath( self.__config.gccxml_path ) ) + # Add all cflags passed + if self.__config.cflags != "": + cmd.append(" %s "%self.__config.cflags) + #second all additional includes directories + cmd.append( ''.join( [' -I"%s"' % search_dir for search_dir in self.__search_directories] ) ) + #third all additional defined symbols + cmd.append( ''.join( [' -D"%s"' % defined_symbol for defined_symbol in self.__config.define_symbols] ) ) + cmd.append( ''.join( [' -U"%s"' % undefined_symbol for undefined_symbol in self.__config.undefine_symbols] ) ) + #fourth source file + cmd.append( '"%s"' % file ) + #five destination file + cmd.append( '-fxml="%s"' % xmlfile ) + if self.__config.start_with_declarations: + cmd.append( '-fxml-start="%s"' % ','.join( self.__config.start_with_declarations ) ) + + cmd_line = ' '.join(cmd) + if 'win32' in sys.platform : + cmd_line = '"%s"' % cmd_line + self.logger.info( 'gccxml cmd: %s' % cmd_line ) + return cmd_line + + def create_xml_file( self, header, destination=None ): + """ + This function will return the file name of the file, created by GCC-XML + for "header" file. If destination_file_path is not None, then this file + path will be used and returned. + + @param header: path to source file, that should be parsed + @type header: str + + @param destination: if given, will be used as target file/path for + GCC-XML generated file. + @type destination: str + + @return: path to GCC-XML generated file + """ + gccxml_file = destination + # If file specified, remove it to start else create new file name + if gccxml_file: + pygccxml.utils.remove_file_no_raise( gccxml_file ) + else: + gccxml_file = pygccxml.utils.create_temp_file_name( suffix='.xml' ) + try: + ffname = header + if not os.path.isabs( ffname ): + ffname = self.__file_full_name(header) + command_line = self.__create_command_line( ffname, gccxml_file ) + input_, output = os.popen4( command_line ) + input_.close() + gccxml_reports = [] + while True: + data = output.readline() + gccxml_reports.append( data ) + if not data: + break + exit_status = output.close() + gccxml_msg = ''.join(gccxml_reports) + if self.__config.ignore_gccxml_output: + if not os.path.isfile(gccxml_file): + raise gccxml_runtime_error_t( "Error occured while running GCC-XML: %s status:%s" % (gccxml_msg, exit_status) ) + else: + if gccxml_msg or exit_status or not os.path.isfile(gccxml_file): + raise gccxml_runtime_error_t( "Error occured while running GCC-XML: %s" % gccxml_msg ) + except Exception, error: + pygccxml.utils.remove_file_no_raise( gccxml_file ) + raise error + return gccxml_file + + def create_xml_file_from_string( self, content, destination=None ): + """ + Creates XML file from text. + + @param content: C++ source code + @type content: str + + @param destination: file name for GCC-XML generated file + @type destination: str + + @return: returns file name of GCC-XML generated file + """ + header_file = pygccxml.utils.create_temp_file_name( suffix='.h' ) + gccxml_file = None + try: + header_file_obj = file(header_file, 'w+') + header_file_obj.write( content ) + header_file_obj.close() + gccxml_file = self.create_xml_file( header_file, destination ) + finally: + pygccxml.utils.remove_file_no_raise( header_file ) + return gccxml_file + + def read_file(self, source_file): + """ + Reads C++ source file and returns declarations tree + + @param source_file: path to C++ source file + @type source_file: str + """ + declarations, types = None, None + gccxml_file = '' + try: + ffname = self.__file_full_name(source_file) + self.logger.debug( "Reading source file: [%s]." % ffname ) + declarations = self.__dcache.cached_value( ffname, self.__config ) + if not declarations: + self.logger.debug( "File has not been found in cache, parsing..." ) + gccxml_file = self.create_xml_file( ffname ) + declarations, files = self.__parse_gccxml_created_file( gccxml_file ) + self.__dcache.update( ffname, self.__config, declarations, files ) + else: + self.logger.debug( "File has not been changed, reading declarations from cache." ) + except Exception, error: + if gccxml_file: + pygccxml.utils.remove_file_no_raise( gccxml_file ) + raise error + if gccxml_file: + pygccxml.utils.remove_file_no_raise( gccxml_file ) + return declarations + + def read_xml_file(self, gccxml_created_file): + """ + Reads GCC-XML generated XML file. + + @param gccxml_created_file: path to GCC-XML generated file + @type gccxml_created_file: str + + @return: declarations tree + """ + self.logger.debug( "Reading xml file: [%s]" % gccxml_created_file ) + + declarations, files = self.__parse_gccxml_created_file( gccxml_created_file ) + return declarations + + def read_string(self, content): + """ + Reads Python string, that contains valid C++ code, and returns + declarations tree. + """ + header_file = pygccxml.utils.create_temp_file_name( suffix='.h' ) + header_file_obj = file(header_file, 'w+') + header_file_obj.write( content ) + header_file_obj.close() + declarations = None + try: + declarations = self.read_file( header_file ) + except Exception, error: + pygccxml.utils.remove_file_no_raise( header_file ) + raise error + pygccxml.utils.remove_file_no_raise( header_file ) + return declarations + + def __file_full_name( self, file ): + if os.path.isfile( file ): + return file + for path in self.__search_directories: + file_path = os.path.join( path, file ) + if os.path.isfile( file_path ): + return file_path + raise RuntimeError( "pygccxml error: file '%s' does not exist" % file ) + + def __produce_full_file( self, file_path ): + if os.path.isabs( file_path ): + return file_path + try: + abs_file_path = os.path.realpath( os.path.join( self.__config.working_directory, file_path ) ) + if os.path.exists( abs_file_path ): + return os.path.normpath( abs_file_path ) + return file_path + except Exception: + return file_path + + def __parse_gccxml_created_file( self, gccxml_file ): + scanner_ = scanner.scanner_t( gccxml_file, self.__decl_factory ) + scanner_.read() + decls = scanner_.declarations() + types = scanner_.types() + files = {} + for file_id, file_path in scanner_.files().items(): + files[file_id] = self.__produce_full_file(file_path) + linker_ = linker.linker_t( decls=decls + , types=types + , access=scanner_.access() + , membership=scanner_.members() + , files=files ) + for type_ in list( types.itervalues() ): + #I need this copy because internaly linker change types collection + linker_.instance = type_ + apply_visitor( linker_, type_ ) + for decl in decls.itervalues(): + linker_.instance = decl + apply_visitor( linker_, decl ) + bind_aliases( decls.itervalues() ) + decls = filter( lambda inst: isinstance(inst, declaration_t) and not inst.parent, decls.itervalues() ) + #some times gccxml report typedefs defined in no namespace + #it happens for example in next situation + #template< typename X> + #void ddd(){ typedef typename X::Y YY;} + decls = filter( lambda inst: isinstance( inst, namespace_t ), decls ) + decls = patcher.patch_it( decls ) + decls_all = make_flatten( decls ) + for decl in decls_all: + if decl.location: + decl.location.file_name = self.__produce_full_file( decl.location.file_name ) + return ( decls, files.values() ) + Modified: pygccxml_dev/pygccxml/utils/__init__.py =================================================================== --- pygccxml_dev/pygccxml/utils/__init__.py 2006-07-10 19:12:24 UTC (rev 290) +++ pygccxml_dev/pygccxml/utils/__init__.py 2006-07-11 07:24:56 UTC (rev 291) @@ -9,7 +9,7 @@ import tempfile def _create_logger_( name ): - logger = logging.getLogger('name') + logger = logging.getLogger(name) __handler = logging.StreamHandler(sys.stdout) __handler.setFormatter( logging.Formatter( '%(levelname)s %(message)s' ) ) logger.addHandler(__handler) @@ -17,10 +17,11 @@ return logger class loggers: - root = _create_logger_( 'pygccxml' ) gccxml = _create_logger_( 'pygccxml.gccxml' ) queries_engine = _create_logger_( 'pygccxml.queries_engine' ) declarations_cache = _create_logger_( 'pygccxml.declarations_cache' ) + #root logger exists for configuration purpose only + root = logging.getLogger( 'pygccxml' ) all = [ root, gccxml, queries_engine, declarations_cache ] def remove_file_no_raise(file_name ): Modified: pyplusplus_dev/examples/pyboost_dev/dev/boost_random/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/dev/boost_random/generate_code.py 2006-07-10 19:12:24 UTC (rev 290) +++ pyplusplus_dev/examples/pyboost_dev/dev/boost_random/generate_code.py 2006-07-11 07:24:56 UTC (rev 291) @@ -1,162 +1,161 @@ -#! /usr/bin/python -# 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 time -import logging -import random_settings -from pygccxml import parser -from pyplusplus import module_builder -from pyplusplus.module_builder import call_policies - - -LICENSE = """// Copyright 2004 Roman Yakovenko. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -""" - -class code_generator_t(object): - def __init__(self): - module_builder.set_logger_level( logging.INFO ) - self.__file = os.path.join( random_settings.working_dir, 'random_export.hpp' ) - self.__mb = module_builder.module_builder_t( - [ parser.create_cached_source_fc( - self.__file - , os.path.join( random_settings.generated_files_dir, 'random.xml' ) ) ] - , gccxml_path=random_settings.gccxml.executable +#! /usr/bin/python +# 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 time +import logging +import random_settings +from pygccxml import parser +from pyplusplus import module_builder +from pyplusplus.module_builder import call_policies + + +LICENSE = """// Copyright 2004 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +""" + +class code_generator_t(object): + def __init__(self): + self.__file = os.path.join( random_settings.working_dir, 'random_export.hpp' ) + self.__mb = module_builder.module_builder_t( + [ parser.create_cached_source_fc( + self.__file + , os.path.join( random_settings.generated_files_dir, 'random.xml' ) ) ] + , gccxml_path=random_settings.gccxml.executable , include_paths=[random_settings.boost.include] - , define_symbols=random_settings.defined_symbols + , define_symbols=random_settings.defined_symbols , undefine_symbols=random_settings.undefined_symbols , indexing_suite_version=2) - self.generators = [ "ecuyer1988" - , "hellekalek1995" - , "kreutzer1986" - , "lagged_fibonacci1279" - , "lagged_fibonacci19937" - , "lagged_fibonacci2281" - , "lagged_fibonacci23209" - , "lagged_fibonacci3217" - , "lagged_fibonacci4423" - , "lagged_fibonacci44497" - , "lagged_fibonacci607" - , "lagged_fibonacci9689" - , "minstd_rand" - , "minstd_rand0" - , "mt11213b" - , "mt19937" - , "ranlux3" - , "ranlux3_01" - , "ranlux4" - , "ranlux4_01" - , "ranlux64_3_01" - , "ranlux64_4_01" - , "taus88" ] - - self.no_min_max = [ 'py_cauchy_distribution' - , 'py_bernoulli_distribution' - , 'py_binomial_distribution' - , 'py_poisson_distribution' - , 'py_normal_distribution' - , 'py_gamma_distribution' - , 'py_triangle_distribution' - , 'py_uniform_on_sphere' - , 'py_exponential_distribution' - , 'py_geometric_distribution' - , 'py_lognormal_distribution' - ] - - def typedef2class( self, scope, name ): - typedef = scope.typedef( name ) - return typedef.type.declaration - + self.generators = [ "ecuyer1988" + , "hellekalek1995" + , "kreutzer1986" + , "lagged_fibonacci1279" + , "lagged_fibonacci19937" + , "lagged_fibonacci2281" + , "lagged_fibonacci23209" + , "lagged_fibonacci3217" + , "lagged_fibonacci4423" + , "lagged_fibonacci44497" + , "lagged_fibonacci607" + , "lagged_fibonacci9689" + , "minstd_rand" + , "minstd_rand0" + , "mt11213b" + , "mt19937" + , "ranlux3" + , "ranlux3_01" + , "ranlux4" + , "ranlux4_01" + , "ranlux64_3_01" + , "ranlux64_4_01" + , "taus88" ] + + self.no_min_max = [ 'py_cauchy_distribution' + , 'py_bernoulli_distribution' + , 'py_binomial_distribution' + , 'py_poisson_distribution' + , 'py_normal_distribution' + , 'py_gamma_distribution' + , 'py_triangle_distribution' + , 'py_uniform_on_sphere' + , 'py_exponential_distribution' + , 'py_geometric_distribution' + , 'py_lognormal_distribution' + ] + + def typedef2class( self, scope, name ): + typedef = scope.typedef( name ) + return typedef.type.declaration + def filter_declarations(self ): - self.__mb.global_ns.exclude() - boost_ns = self.__mb.global_ns.namespace( 'boost', recursive=False ) - for name in self.generators: - gen_cls = self.typedef2class( boost_ns, name ) - gen_cls.include() - #TODO: find out why compiler complains - gen_cls.member_functions( 'seed' ).create_with_signature = True - - pyimpl_ns = boost_ns.namespace( 'pyimpl' ) - helpers = pyimpl_ns.classes( lambda decl: decl.name.startswith( 'py_') ) - helpers.include() - for helper in helpers: - distrib_cls = self.typedef2class( helper, "distribution" ) - distrib_cls.include() - var_gen_typedefs = helper.typedefs( lambda decl: decl.name.startswith( 'variate_generator_' ) ) - for var_gen_typedef in var_gen_typedefs: - var_gen_cls = var_gen_typedef.type.declaration - var_gen_cls.include() - var_gen_cls.member_operators( symbol='()' ).create_with_signature = True - if helper.name in self.no_min_max: - var_gen_cls.member_function( 'max' ).exclude() - var_gen_cls.member_function( 'min' ).exclude() - - ecuyer1988 = self.typedef2class( boost_ns, 'ecuyer1988' ) - ecuyer1988.member_function( 'seed', arg_types=[None, None] ).exclude() - - def prepare_declarations( self ): - boost_ns = self.__mb.namespace( 'boost' ) - for name in self.generators: - gen_cls = self.typedef2class( boost_ns, name ) - gen_cls.alias = name - - pyimpl_ns = boost_ns.namespace( 'pyimpl' ) - helpers = pyimpl_ns.classes( lambda decl: decl.name.startswith( 'py_') ) - for helper in helpers: - distrib_cls = self.typedef2class( helper, "distribution" ) - distrib_cls.alias = helper.name[3:] #py_ - var_gen_typedefs = helper.typedefs( lambda decl: decl.name.startswith( 'variate_generator_' ) ) - for var_gen_typedef in var_gen_typedefs: - var_gen_cls = var_gen_typedef.type.declaration - var_gen_cls.alias = var_gen_typedef.name + '__' + distrib_cls.alias - - self.set_call_policies() - - def set_call_policies( self ): - boost_ns = self.__mb.namespace( 'boost' ) - engine_funcs = boost_ns.member_functions( name="engine" - , function=lambda decl: not decl.has_const ) - engine_funcs.call_policies = call_policies.return_internal_reference() - - distribution_funcs = boost_ns.member_functions( name="distribution" - , function=lambda decl: not decl.has_const ) - distribution_funcs.call_policies = call_policies.return_internal_reference() - - def customize_extmodule( self ): + self.__mb.global_ns.exclude() + boost_ns = self.__mb.global_ns.namespace( 'boost', recursive=False ) + for name in self.generators: + gen_cls = self.typedef2class( boost_ns, name ) + gen_cls.include() + #TODO: find out why compiler complains + gen_cls.member_functions( 'seed' ).create_with_signature = True + + pyimpl_ns = boost_ns.namespace( 'pyimpl' ) + helpers = pyimpl_ns.classes( lambda decl: decl.name.startswith( 'py_') ) + helpers.include() + for helper in helpers: + distrib_cls = self.typedef2class( helper, "distribution" ) + distrib_cls.include() + var_gen_typedefs = helper.typedefs( lambda decl: decl.name.startswith( 'variate_generator_' ) ) + for var_gen_typedef in var_gen_typedefs: + var_gen_cls = var_gen_typedef.type.declaration + var_gen_cls.include() + var_gen_cls.member_operators( symbol='()' ).create_with_signature = True + if helper.name in self.no_min_max: + var_gen_cls.member_function( 'max' ).exclude() + var_gen_cls.member_function( 'min' ).exclude() + + ecuyer1988 = self.typedef2class( boost_ns, 'ecuyer1988' ) + ecuyer1988.member_function( 'seed', arg_types=[None, None] ).exclude() + + def prepare_declarations( self ): + boost_ns = self.__mb.namespace( 'boost' ) + for name in self.generators: + gen_cls = self.typedef2class( boost_ns, name ) + gen_cls.alias = name + + pyimpl_ns = boost_ns.namespace( 'pyimpl' ) + helpers = pyimpl_ns.classes( lambda decl: decl.name.startswith( 'py_') ) + for helper in helpers: + distrib_cls = self.typedef2class( helper, "distribution" ) + distrib_cls.alias = helper.name[3:] #py_ + var_gen_typedefs = helper.typedefs( lambda decl: decl.name.startswith( 'variate_generator_' ) ) + for var_gen_typedef in var_gen_typedefs: + var_gen_cls = var_gen_typedef.type.declaration + var_gen_cls.alias = var_gen_typedef.name + '__' + distrib_cls.alias + + self.set_call_policies() + + def set_call_policies( self ): + boost_ns = self.__mb.namespace( 'boost' ) + engine_funcs = boost_ns.member_functions( name="engine" + , function=lambda decl: not decl.has_const ) + engine_funcs.call_policies = call_policies.return_internal_reference() + + distribution_funcs = boost_ns.member_functions( name="distribution" + , function=lambda decl: not decl.has_const ) + distribution_funcs.call_policies = call_policies.return_internal_reference() + + def customize_extmodule( self ): global LICENSE - extmodule = self.__mb.code_creator - extmodule.license = LICENSE - extmodule.user_defined_directories.append( random_settings.boost.include ) - extmodule.user_defined_directories.append( random_settings.working_dir ) - extmodule.user_defined_directories.append( random_settings.generated_files_dir ) - extmodule.precompiled_header = 'boost/python.hpp' - extmodule.replace_included_headers( ['boost/random.hpp', 'boost/nondet_random.hpp', 'random_export.hpp' ] ) - - def write_files( self ): - self.__mb.split_module( random_settings.generated_files_dir ) - - def create(self): - start_time = time.clock() + extmodule = self.__mb.code_creator + extmodule.license = LICENSE + extmodule.user_defined_directories.append( random_settings.boost.include ) + extmodule.user_defined_directories.append( random_settings.working_dir ) + extmodule.user_defined_directories.append( random_settings.generated_files_dir ) + extmodule.precompiled_header = 'boost/python.hpp' + extmodule.replace_included_headers( ['boost/random.hpp', 'boost/nondet_random.hpp', 'random_export.hpp' ] ) + + def write_files( self ): + self.__mb.split_module( random_settings.generated_files_dir ) + + def create(self): + start_time = time.clock() self.filter_declarations() - self.prepare_declarations() - self.__mb.build_code_creator( random_settings.module_name ) - - self.customize_extmodule() - self.write_files( ) - print 'time taken : ', time.clock() - start_time, ' seconds' - -def export(): - cg = code_generator_t() - cg.create() - -if __name__ == '__main__': - export() - print 'done' - - + self.prepare_declarations() + self.__mb.build_code_creator( random_settings.module_name ) + + self.customize_extmodule() + self.write_files( ) + print 'time taken : ', time.clock() - start_time, ' seconds' + +def export(): + cg = code_generator_t() + cg.create() + +if __name__ == '__main__': + export() + print 'done' + + Modified: pyplusplus_dev/examples/pyboost_dev/dev/crc/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/dev/crc/generate_code.py 2006-07-10 19:12:24 UTC (rev 290) +++ pyplusplus_dev/examples/pyboost_dev/dev/crc/generate_code.py 2006-07-11 07:24:56 UTC (rev 291) @@ -21,7 +21,6 @@ class code_generator_t(object): def __init__(self): - module_builder.set_logger_level( logging.INFO ) self.__file = os.path.join( crc_settings.working_dir, 'crc_export.hpp' ) self.__mb = module_builder.module_builder_t( @@ -31,7 +30,8 @@ , gccxml_path=crc_settings.gccxml.executable , include_paths=[crc_settings.boost.include] , define_symbols=crc_settings.defined_symbols - , undefine_symbols=crc_settings.undefined_symbols) + , undefine_symbols=crc_settings.undefined_symbols + , indexing_suite_version=2) def filter_declarations(self ): self.__mb.global_ns.exclude() Modified: pyplusplus_dev/examples/pyboost_dev/dev/date_time/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/dev/date_time/generate_code.py 2006-07-10 19:12:24 UTC (rev 290) +++ pyplusplus_dev/examples/pyboost_dev/dev/date_time/generate_code.py 2006-07-11 07:24:56 UTC (rev 291) @@ -18,7 +18,6 @@ class code_generator_t(object): def __init__(self): - module_builder.set_logger_level( logging.INFO ) self.__file = os.path.join( date_time_settings.date_time_pypp_include, 'date_time.pypp.hpp' ) def _create_xml_file( self ): Modified: pyplusplus_dev/examples/pyboost_dev/dev/rational/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/dev/rational/generate_code.py 2006-07-10 19:12:24 UTC (rev 290) +++ pyplusplus_dev/examples/pyboost_dev/dev/rational/generate_code.py 2006-07-11 07:24:56 UTC (rev 291) @@ -22,9 +22,7 @@ #TODO: for some reason unary - was not exported class code_generator_t(object): - def __init__(self): - module_builder.set_logger_level( logging.INFO ) - + def __init__(self): self.__file = os.path.join( rational_settings.working_dir, 'rational_export.hpp' ) self.__mb = module_builder.module_builder_t( @@ -35,7 +33,8 @@ , include_paths=[rational_settings.boost.include] , define_symbols=rational_settings.defined_symbols , undefine_symbols=rational_settings.undefined_symbols - , optimize_queries=False ) + , optimize_queries=False + , indexing_suite_version=2 ) for f_decl in self.__mb.free_functions(): f_decl.alias = f_decl.name Modified: pyplusplus_dev/pyplusplus/_logging_/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/_logging_/__init__.py 2006-07-10 19:12:24 UTC (rev 290) +++ pyplusplus_dev/pyplusplus/_logging_/__init__.py 2006-07-11 07:24:56 UTC (rev 291) @@ -11,9 +11,19 @@ import sys import logging - -logger = logging.getLogger('pyplusplus') -__handler = logging.StreamHandler(sys.stdout) -__handler.setFormatter( logging.Formatter('%(message)s') ) -logger.addHandler(__handler) -logger.setLevel(logging.DEBUG) \ No newline at end of file + +def _create_logger_( name ): + logger = logging.getLogger(name) + __handler = logging.StreamHandler(sys.stdout) + __handler.setFormatter( logging.Formatter( '%(levelname)s %(message)s' ) ) + logger.addHandler(__handler) + logger.setLevel(logging.INFO) + return logger + +class loggers: + file_writer = _create_logger_( 'pyplusplus.file_writer' ) + declarations = _create_logger_( 'pyplusplus.declarations' ) + module_builder = _create_logger_( 'pyplusplus.module_builder' ) + #root logger exists for configuration purpose only + root = logging.getLogger( 'pyplusplus' ) + all = [ root, file_writer, module_builder ] Modified: pyplusplus_dev/pyplusplus/code_creators/calldef.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/calldef.py 2006-07-10 19:12:24 UTC (rev 290) +++ pyplusplus_dev/pyplusplus/code_creators/calldef.py 2006-07-11 07:24:56 UTC (rev 291) @@ -78,15 +78,24 @@ def _get_function_type_alias( self ): return 'function_ptr_t' function_type_alias = property( _get_function_type_alias ) - - def create_function_type_alias_code( self ): + + def _get_exported_class_alias( self ): + return 'exported_class_t' + exported_class_alias = property( _get_exported_class_alias ) + + def create_function_type_alias_code( self, exported_class_alias=None ): raise NotImplementedError() def _create_impl( self ): result = [] - if False == self.works_on_instance: - result.append( self.create_function_type_alias_code() ) + if False == self.works_on_instance: + exported_class_alias = None + if declarations.templates.is_instantiation( self.declaration.parent.name ): + exported_class_alias = self.exported_class_alias + result.append( 'typedef %s %s;' % ( self.parent.decl_identifier, exported_class_alias ) ) + result.append( os.linesep ) + result.append( self.create_function_type_alias_code(exported_class_alias) ) result.append( os.linesep * 2 ) result.append( self.create_def_code() + '( ' ) @@ -190,7 +199,7 @@ def create_def_code( self ): return self.def_identifier() - def create_function_type_alias_code( self ): + def create_function_type_alias_code( self, exported_class_alias=None ): return 'typedef ' + self.declaration.function_type().create_typedef( self.function_type_alias ) + ';' def create_function_ref_code(self, use_function_alias=False): @@ -208,8 +217,9 @@ def __init__( self, function ): calldef_t.__init__( self, function=function ) - def create_function_type_alias_code( self ): - return 'typedef ' + self.declaration.function_type().create_typedef( self.function_type_alias ) + ';' + def create_function_type_alias_code( self, exported_class_alias=None ): + ftype = self.declaration.function_type() + return 'typedef %s;' % ftype.create_typedef( self.function_type_alias, exported_class_alias ) def create_function_ref_code(self, use_function_alias=False): if use_function_alias: @@ -227,8 +237,9 @@ def __init__( self, function, wrapper ): calldef_t.__init__( self, function=function, wrapper=wrapper ) - def create_function_type_alias_code( self ): - return 'typedef ' + self.declaration.function_type().create_typedef( self.function_type_alias ) + ';' + def create_function_type_alias_code( self, exported_class_alias=None ): + ftype = self.declaration.function_type() + return 'typedef %s;' % ftype.create_typedef( self.function_type_alias, exported_class_alias ) def create_function_ref_code(self, use_function_alias=False): if use_function_alias: @@ -295,12 +306,15 @@ calldef_t.__init__( self, function=function, wrapper=wrapper ) self.default_function_type_alias = 'default_' + self.function_type_alias - def create_function_type_alias_code( self ): - result = [] - result.append( 'typedef ' + self.declaration.function_type().create_typedef( self.function_type_alias ) + ';' ) + def create_function_type_alias_code( self, exported_class_alias=None ): + result = [] + + ftype = self.declaration.function_type() + result.append( 'typedef %s;' % ftype.create_typedef( self.function_type_alias, exported_class_alias ) ) if self.wrapper: - result.append( os.linesep ) - result.append( 'typedef ' + self.wrapper.function_type().create_typedef( self.default_function_type_alias ) + ';' ) + result.append( os.linesep ) + ftype = self.wrapper.function_type() + result.append( 'typedef %s;' % ftype.create_typedef( self.default_function_type_alias ) ) return ''.join( result ) def create_function_ref_code(self, use_function_alias=False): @@ -413,8 +427,9 @@ def __init__( self, function, wrapper ): calldef_t.__init__( self, function=function, wrapper=wrapper ) - def create_function_type_alias_code( self ): - return 'typedef ' + self.wrapper.function_type().create_typedef( self.function_type_alias ) + ';' + def create_function_type_alias_code( self, exported_class_alias=None ): + ftype = self.wrapper.function_type() + return 'typedef ' + ftype.create_typedef( self.function_type_alias ) + ';' def create_function_ref_code(self, use_function_alias=False): if use_function_alias: @@ -484,8 +499,9 @@ def __init__( self, function, wrapper ): calldef_t.__init__( self, function=function, wrapper=wrapper ) - def create_function_type_alias_code( self ): - return 'typedef ' + self.wrapper.function_type().create_typedef( self.function_type_alias ) + ';' + def create_function_type_alias_code( self, exported_class_alias=None ): + ftype = self.wrapper.function_type() + return 'typedef %s;' % ftype.create_typedef( self.function_type_alias ) def create_function_ref_code(self, use_function_alias=False): if use_function_alias: @@ -546,8 +562,9 @@ def __init__( self, function, wrapper ): calldef_t.__init__( self, function=function, wrapper=wrapper ) - def create_function_type_alias_code( self ): - return 'typedef ' + self.wrapper.function_type().create_typedef( self.function_type_alias ) + ';' + def create_function_type_alias_code( self, exported_class_alias=None ): + ftype = self.wrapper.function_type() + return 'typedef %s;' % ftype.create_typedef( self.function_type_alias ) def create_function_ref_code(self, use_function_alias=False): if use_function_alias: @@ -622,8 +639,9 @@ def __init__( self, function, wrapper ): calldef_t.__init__( self, function=function, wrapper=wrapper ) - def create_function_type_alias_code( self ): - return 'typedef ' + self.wrapper.function_type().create_typedef( self.function_type_alias ) + ';' + def create_function_type_alias_code( self, exported_class_alias=None ): + ftype = self.wrapper.function_type() + return 'typedef %s;' % ftype.create_typedef( self.function_type_alias ) def create_function_ref_code(self, use_function_alias=False): if use_function_alias: Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2006-07-10 19:12:24 UTC (rev 290) +++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2006-07-11 07:24:56 UTC (rev 291) @@ -6,7 +6,6 @@ import os import decl_wrapper from pygccxml import declarations -from pyplusplus import _logging_ ##May be in future I will enable this functionality again, right now it seems ##that this is useless ##def is_finalizable(self): @@ -104,7 +103,7 @@ msg = "Function '%s' with more then 10 arguments( %d ). " msg = msg + " You should adjest BOOST_PYTHON_MAX_ARITY" msg = msg + " For more information see: http://mail.python.org/pipermail/c++-sig/2002-June/001554.html" - _logging_.logger.info( msg % ( self.decl_string, len( self.arguments ) ) ) + self.logger.info( msg % ( self.decl_string, len( self.arguments ) ) ) all_type... [truncated message content] |