[pygccxml-commit] SF.net SVN: pygccxml:[1690] pyplusplus_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2009-02-18 13:27:09
|
Revision: 1690 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1690&view=rev Author: roman_yakovenko Date: 2009-02-18 13:27:04 +0000 (Wed, 18 Feb 2009) Log Message: ----------- sphinx Modified Paths: -------------- pygccxml_dev/docs/history/history.rest pygccxml_dev/pygccxml/parser/config.py pyplusplus_dev/pyplusplus/creators_factory/bpcreator.py pyplusplus_dev/pyplusplus/module_builder/module_builder.py pyplusplus_dev/unittests/data/vector3_to_be_exported.hpp pyplusplus_dev/unittests/indexing_suites_v2_bug_tester.py pyplusplus_dev/unittests/vector3_tester.py Modified: pygccxml_dev/docs/history/history.rest =================================================================== --- pygccxml_dev/docs/history/history.rest 2009-02-17 20:29:14 UTC (rev 1689) +++ pygccxml_dev/docs/history/history.rest 2009-02-18 13:27:04 UTC (rev 1690) @@ -32,7 +32,8 @@ 2. Ability to extract different information from binary files ( ``.pdb``, ``.so``, ``.map`` ) and merge it with a declarations tree was added. -3. Ability to load `GCC-XML`_ configuration from ``.ini`` like file was added +3. Ability to load `GCC-XML`_ configuration from ``.ini`` like file was added. + See :func:`pygccxml.parser.config.load_gccxml_configuration` for details. 4. From now on, :doc:`pygccxml <../pygccxml>` will use `Sphinx <http://sphinx.pocoo.org/>`_ for all documentation. Modified: pygccxml_dev/pygccxml/parser/config.py =================================================================== --- pygccxml_dev/pygccxml/parser/config.py 2009-02-17 20:29:14 UTC (rev 1689) +++ pygccxml_dev/pygccxml/parser/config.py 2009-02-18 13:27:04 UTC (rev 1690) @@ -198,7 +198,8 @@ config_t = gccxml_configuration_t #backward computability gccxml_configuration_example = \ -"""[gccxml] +""" +[gccxml] #path to gccxml executable file - optional, if not provided, os.environ['PATH'] #variable is used to find it gccxml_path= @@ -210,24 +211,34 @@ #You can explicitly set what compiler it should emulate. #Valid options are: g++, msvc6, msvc7, msvc71, msvc8, cl. compiler= - -#GCC-XML site: http://gccxml.org/ """ def load_gccxml_configuration( configuration, **defaults ): - """loads GCC-XML configuration from a file + """ + loads GCC-XML configuration from an `.ini` file or any other file class + :class:`ConfigParser.SafeConfigParser` is able to parse. - Configuration file sceleton: + :param configuration: configuration could be string( configuration file path ) + or instance of :class:`ConfigParser.SafeConfigParser` class - >>> start <<< + :rtype: :class:`.gccxml_configuration_t` - %s + Configuration file sceleton:: - >>> end <<< + [gccxml] + #path to gccxml executable file - optional, if not provided, os.environ['PATH'] + #variable is used to find it + gccxml_path= + #gccxml working directory - optional, could be set to your source code directory + working_directory= + #additional include directories, separated by ';' or ':' + include_paths= + #gccxml has a nice algorithms, which selects what C++ compiler to emulate. + #You can explicitly set what compiler it should emulate. + #Valid options are: g++, msvc6, msvc7, msvc71, msvc8, cl. + compiler= - configuration could be string( configuration file path ) or instance of - ConfigParser.SafeConfigParser class - """ % gccxml_configuration_example + """ parser = configuration if isinstance( configuration, types.StringTypes ): from ConfigParser import SafeConfigParser Modified: pyplusplus_dev/pyplusplus/creators_factory/bpcreator.py =================================================================== --- pyplusplus_dev/pyplusplus/creators_factory/bpcreator.py 2009-02-17 20:29:14 UTC (rev 1689) +++ pyplusplus_dev/pyplusplus/creators_factory/bpcreator.py 2009-02-18 13:27:04 UTC (rev 1690) @@ -170,7 +170,9 @@ pass else: assert not "Found %d class code creators" % len(creator) - + import pdb + if '<<' == operator.symbol: + pdb.set_trace() find = code_creators.creator_finder.find_by_declaration if operator.target_class and operator.target_class.ignore == False: found = find( lambda decl: operator.target_class is decl Modified: pyplusplus_dev/pyplusplus/module_builder/module_builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/module_builder.py 2009-02-17 20:29:14 UTC (rev 1689) +++ pyplusplus_dev/pyplusplus/module_builder/module_builder.py 2009-02-18 13:27:04 UTC (rev 1690) @@ -131,7 +131,6 @@ """Please see :class:`decl_wrappers.scopedef_t` class documentation""" return self.global_ns.operator( name=name , symbol=symbol - , decl_type=decl_type , return_type=return_type , arg_types=arg_types , header_dir=header_dir @@ -142,7 +141,6 @@ """Please see :class:`decl_wrappers.scopedef_t` class documentation""" return self.global_ns.operators( name=name , symbol=symbol - , decl_type=decl_type , return_type=return_type , arg_types=arg_types , header_dir=header_dir Modified: pyplusplus_dev/unittests/data/vector3_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/vector3_to_be_exported.hpp 2009-02-17 20:29:14 UTC (rev 1689) +++ pyplusplus_dev/unittests/data/vector3_to_be_exported.hpp 2009-02-18 13:27:04 UTC (rev 1690) @@ -6,6 +6,8 @@ #ifndef __vector3_to_be_exported_hpp__ #define __vector3_to_be_exported_hpp__ +#include <iostream> + namespace vector3{ class Vector3 @@ -60,6 +62,11 @@ { } + friend + std::ostream& operator<<(std::ostream& out, const Vector3& v ){ + out << "( " << v.x << "," << v.y << "," << v.z << ")"; + } + inline float operator [] ( const unsigned int i ) const { return *(&x+i); @@ -303,6 +310,7 @@ }; + } #endif//__class_order_to_be_exported_hpp__ \ No newline at end of file Modified: pyplusplus_dev/unittests/indexing_suites_v2_bug_tester.py =================================================================== --- pyplusplus_dev/unittests/indexing_suites_v2_bug_tester.py 2009-02-17 20:29:14 UTC (rev 1689) +++ pyplusplus_dev/unittests/indexing_suites_v2_bug_tester.py 2009-02-18 13:27:04 UTC (rev 1690) @@ -4,35 +4,27 @@ # http://www.boost.org/LICENSE_1_0.txt) import os -import dl import sys import unittest import autoconfig import fundamental_tester_base from pyplusplus import code_creators -sys.setdlopenflags(dl.RTLD_NOW | dl.RTLD_GLOBAL) +if 'linux' in sys.platform: + import dl + sys.setdlopenflags(dl.RTLD_NOW | dl.RTLD_GLOBAL) - - class tester_t(fundamental_tester_base.fundamental_tester_base_t): def __init__( self, *args ): fundamental_tester_base.fundamental_tester_base_t.__init__( self, self.EXTENSION_NAME, indexing_suite_version=2, *args ) def run_tests(self, module): - try: - v = module.create_vector() - print self.__class__.__name__ - for i in v: - print i - print self.__class__.__name__, ' - done' - print self.__class__.__name__ - for i in v: - print i - print self.__class__.__name__, ' - done(2)' - except Exception, ex: - print 'Error: ', str( ex ) - + v = module.create_vector() + for i in v: + i += 1 + for i in v: + i += 1 + class tester_a_t(tester_t): EXTENSION_NAME = 'indexing_suites_v2_bug_a' def __init__( self, *args ): @@ -44,7 +36,6 @@ def __init__( self, *args ): tester_t.__init__( self, *args ) - def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_a_t)) Modified: pyplusplus_dev/unittests/vector3_tester.py =================================================================== --- pyplusplus_dev/unittests/vector3_tester.py 2009-02-17 20:29:14 UTC (rev 1689) +++ pyplusplus_dev/unittests/vector3_tester.py 2009-02-18 13:27:04 UTC (rev 1690) @@ -11,9 +11,9 @@ class tester_t(fundamental_tester_base.fundamental_tester_base_t): EXTENSION_NAME = 'vector3' - + def __init__( self, *args ): - fundamental_tester_base.fundamental_tester_base_t.__init__( + fundamental_tester_base.fundamental_tester_base_t.__init__( self , tester_t.EXTENSION_NAME , *args ) @@ -26,16 +26,19 @@ vec3.add_registration_code( 'add_property( "x", &vector3::Vector3::x)' ) vec3.add_registration_code( 'add_property( "y", &vector3::Vector3::y)' ) vec3.add_registration_code( 'add_property( "z", &vector3::Vector3::z)' ) + mb.operator( lambda o: o.symbol == '<<' and 'Vector3' in o.decl_string ).include() - def run_tests( self, module): v3 = module.Vector3() self.failUnless( v3.ZERO == v3.do_smth() ) #test copy constructor self.failUnless( module.Vector3(v3.ZERO) == v3.do_smth() ) - + + x = module.Vector3( 1,2,3) + print str(x) + def create_suite(): - suite = unittest.TestSuite() + suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) return suite This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |