[pygccxml-commit] SF.net SVN: pygccxml: [189] pygccxml_dev/pygccxml/parser
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-05-31 03:55:51
|
Revision: 189 Author: roman_yakovenko Date: 2006-05-30 20:55:37 -0700 (Tue, 30 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=189&view=rev Log Message: ----------- applying Allen patch - gccxml check error Modified Paths: -------------- pygccxml_dev/pygccxml/parser/config.py pygccxml_dev/pygccxml/parser/source_reader.py pyplusplus_dev/pyplusplus/module_builder/builder.py Modified: pygccxml_dev/pygccxml/parser/config.py =================================================================== --- pygccxml_dev/pygccxml/parser/config.py 2006-05-31 03:41:50 UTC (rev 188) +++ pygccxml_dev/pygccxml/parser/config.py 2006-05-31 03:55:37 UTC (rev 189) @@ -27,8 +27,9 @@ , define_symbols=None , undefine_symbols=None , start_with_declarations=None - , verbose=False): - """Constructor. + , verbose=False + , ignore_gccxml_output=False): + """Constructor. """ object.__init__( self ) self.__gccxml_path = gccxml_path @@ -51,6 +52,7 @@ self.__start_with_declarations = start_with_declarations self.__verbose = verbose + self.__ignore_gccxml_output = ignore_gccxml_output def clone(self): return config_t( gccxml_path=self.__gccxml_path @@ -59,7 +61,8 @@ , define_symbols=self.__define_symbols[:] , undefine_symbols=self.__undefine_symbols[:] , start_with_declarations=self.__start_with_declarations[:] - , verbose=self.verbose) + , verbose=self.verbose + , ignore_gccxml_output=self.ignore_gccxml_output) def __get_gccxml_path(self): return self.__gccxml_path @@ -94,3 +97,9 @@ def __set_verbose(self, val=True): self.__verbose = val verbose = property( __get_verbose, __set_verbose ) + + def __get_ignore_gccxml_output(self): + return self.__ignore_gccxml_output + def __set_ignore_gccxml_output(self, val=True): + self.__ignore_gccxml_output = val + ignore_gccxml_output = property( __get_ignore_gccxml_output, __set_ignore_gccxml_output ) Modified: pygccxml_dev/pygccxml/parser/source_reader.py =================================================================== --- pygccxml_dev/pygccxml/parser/source_reader.py 2006-05-31 03:41:50 UTC (rev 188) +++ pygccxml_dev/pygccxml/parser/source_reader.py 2006-05-31 03:55:37 UTC (rev 189) @@ -170,14 +170,11 @@ ffname = header if not os.path.isabs( ffname ): ffname = self.__file_full_name(header) - #input, output = os.popen4( self.__create_command_line( ffname, gccxml_file ) ) - #input.close() command_line = self.__create_command_line( ffname, gccxml_file ) if self.__config.verbose: logger.info( " Command line for GCC-XML: %s" % command_line ) input_, output = os.popen4( command_line ) input_.close() - #output = os.popen(command_line) gccxml_reports = [] while True: data = output.readline() @@ -186,11 +183,12 @@ break exit_status = output.close() gccxml_msg = ''.join(gccxml_reports) - 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 ) - - #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) ) + 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 Modified: pyplusplus_dev/pyplusplus/module_builder/builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/builder.py 2006-05-31 03:41:50 UTC (rev 188) +++ pyplusplus_dev/pyplusplus/module_builder/builder.py 2006-05-31 03:55:37 UTC (rev 189) @@ -33,7 +33,8 @@ , compilation_verbose=False , compilation_mode=None , cache=None - , optimize_queries=True): + , optimize_queries=True + , ignore_gccxml_output=False): """ @param files: list of files, declarations from them you want to export @type files: list of strings or L{file_configuration_t} instances @@ -60,7 +61,8 @@ , define_symbols=define_symbols , undefine_symbols=undefine_symbols , start_with_declarations=start_with_declarations - , verbose=compilation_verbose) + , verbose=compilation_verbose + , ignore_gccxml_output=ignore_gccxml_output) #may be in future I will add those directories to user_defined_directories #to self.__code_creator. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |