pygccxml-commit Mailing List for C++ Python language bindings (Page 66)
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-06-08 05:52:44
|
Revision: 216 Author: roman_yakovenko Date: 2006-06-07 22:52:33 -0700 (Wed, 07 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=216&view=rev Log Message: ----------- adding an ability to save\load last header file Modified Paths: -------------- pyplusplus_dev/docs/history/history.rest pyplusplus_dev/pyplusplus/gui/ui.py Modified: pyplusplus_dev/docs/history/history.rest =================================================================== --- pyplusplus_dev/docs/history/history.rest 2006-06-05 19:49:29 UTC (rev 215) +++ pyplusplus_dev/docs/history/history.rest 2006-06-08 05:52:33 UTC (rev 216) @@ -15,7 +15,15 @@ * John Pallister * Matthias Baas * Allen Bierbaum - * Lakin Wecker + * Lakin Wecker + * Georgiy Dernovoy + +------- +Current +------- + +1. Georgiy Dernovoy contributed a patch, that allows `pyplusplus`_ GUI to save\load + last used header file. ------------- Version 0.8.0 Modified: pyplusplus_dev/pyplusplus/gui/ui.py =================================================================== --- pyplusplus_dev/pyplusplus/gui/ui.py 2006-06-05 19:49:29 UTC (rev 215) +++ pyplusplus_dev/pyplusplus/gui/ui.py 2006-06-08 05:52:33 UTC (rev 216) @@ -15,7 +15,28 @@ from pyplusplus import module_builder import wizard + +class gui_config_t: + + @staticmethod + def config_file(): + config_path = os.getenv( 'HOME', os.path.abspath( os.getcwd() ) ) + return os.path.join( os.path.abspath( config_path ), ".pyplusplus" ) + + @staticmethod + def read_header_name(): + config_path = gui_config_t.config_file() + if os.path.exists(config_path): + return open(config_path).read() + else: + return '' + + @staticmethod + def save_header_name( header_file ): + config_path = gui_config_t.config_file() + open(config_path, "w").write(header_file) + #TODO: add configuration file and ability to start\run it. class custom_frame_t(Tkinter.Frame): @@ -135,6 +156,11 @@ self._header_file = Tkinter.Entry( self, width=35 ) self._header_file.grid(row=1, column=0, sticky=Tkinter.NW + Tkinter.E) + + initial_header = gui_config_t.read_header_name() + if initial_header: + self._header_file.delete( 0, Tkinter.END ) + self._header_file.insert( 0, initial_header ) temp = Tkinter.Button( self, text="...", command=self._select_header_file ) temp.grid( row=1, column=2) @@ -142,7 +168,7 @@ map( lambda i: self.rowconfigure( i, weight=1 ), range(2) ) - def _select_header_file( self ): + def _select_header_file( self ): file_name = tkFileDialog.askopenfilename() if not file_name: return @@ -308,11 +334,14 @@ self._generated_code.set_generated_code( '\n'.join( user_msg ) ) def _generate_code(self): + global save_header_name + try: config = self._parser_configurator.parser_configuration() header_file = self._header_file_configurator.header_file() if not header_file or not os.path.isfile( header_file ): raise RuntimeError( 'Header file "%s" does not exist or should be valid file name.' % header_file ) + gui_config_t.save_header_name( header_file ) config.include_paths.append( os.path.split( header_file )[0] ) start_time = time.clock() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:14:56
|
Revision: 203 Author: roman_yakovenko Date: 2006-06-03 22:42:16 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=203&view=rev Log Message: ----------- Added Paths: ----------- pyplusplus_dev/docs/peps/indexing_suite.rest Added: pyplusplus_dev/docs/peps/indexing_suite.rest =================================================================== --- pyplusplus_dev/docs/peps/indexing_suite.rest (rev 0) +++ pyplusplus_dev/docs/peps/indexing_suite.rest 2006-06-04 05:42:16 UTC (rev 203) @@ -0,0 +1,97 @@ +====================== +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 `pyplusplus`_. +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 `pyplusplus`_ will do in this case: + +1. `pyplusplus`_ 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 `pyplusplus`_ + ``code repository``. + +4. It will generate a code, that 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 `pyplusplus`_ +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 to change the defaults on that class. +:: + + 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, that represents instantiation of some std container will have +class variable ``indexing_suite``, that will be intitialized with relevant +indexing suite class. + + + +.. _`pyplusplus` : ./../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: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:14:53
|
Revision: 204 Author: roman_yakovenko Date: 2006-06-03 22:45:19 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=204&view=rev Log Message: ----------- Added Paths: ----------- pyplusplus_dev/docs/peps/call_wrapper_policies.rest Removed Paths: ------------- pyplusplus_dev/docs/peps/introduction.rest Copied: pyplusplus_dev/docs/peps/call_wrapper_policies.rest (from rev 202, pyplusplus_dev/docs/peps/introduction.rest) =================================================================== --- pyplusplus_dev/docs/peps/call_wrapper_policies.rest (rev 0) +++ pyplusplus_dev/docs/peps/call_wrapper_policies.rest 2006-06-04 05:45:19 UTC (rev 204) @@ -0,0 +1,243 @@ +===================== +call wrapper policies +===================== + +.. contents:: Table of contents + +------------------- +What is useful for? +------------------- +Not all C++ functions could be exposed to Python as is. For example, next function +could not be exposed: +:: + + void get_size( int& size ); + +In order to expose ``get_size`` function, an user need to create next wrapper: +:: + + int get_size_wrapper( ){ + int size(0); + get_size( size ); + return size; + } + +|cwp| will provide the user with simple and intuitive way to instruct +`pyplusplus`_ to generate right wrapper. Also, it will be possible to create +a custom policies. + +This document describes what is *going to be implemented*. + +-------- +Analysis +-------- + +C++ function arguments usage +---------------------------- + +In C++ function argument can be used to: + +* to pass some data to function ( in ) + + there is no need to return variable from the function + +* to return some data from function ( out ) + + there is no need to force Python programmer to pass the variable as argument + to the function + +* both ( in/out ) + +Function-wrapper signature will be a little bit different in every case. + +Variable names +-------------- +I think it should be possible to apply few |cwp| on a single function. +The main, ( read unresolved ) issue, is management of variable names within +function-wrapper. I see next problems, that we should solve, before proceeding +to implementation: + +1. To share variable name, between different pieces of code. + + Right now I think, that every |cwp| will have ``pre-call`` and ``post-call`` + code creators. This design will allow the user to mix few |cwp|'s within + single function-wrapper. + +2. To insure name uniqueness. + +3. To give meaningful name. + +I think, that is it very easy to solve the problem, if I remove "readability" +requirement. + +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: +http://www.boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies +:: + + //C++ code + struct Y + { + X x; Z* z; + int z_value() { return z->value(); } + }; + + X& f(Y& y, Z* z, int& error) + { + y.z = z; + return y.x; + } + + //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 +function could not be called from `Python`_. ( Hint: numbers are immutable +objects in `Python`_ ). So in order to expose function ``f`` to `Python`_, +an user need to create a wrapper. And now he has a problem: how to wrap the function? + +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 + part of the return value? + :: + + boost::tuple f_wrapper( Y& y, Z* z ){ + int error(0); + X& x = f( y, z, error ); + return boost::tuple<X&, int>( x, error ); + } + + 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 + hint? + :: + + boost::python::tuple f_wrapper( Y& y, Z* z ){ + int error(0); + X& x = f( y, z, error ); + boost::python::object x_obj( x, x is internal reference of y ); + return boost::python::make_tuple( x_obj, error ); + } + +Anyway, I think we will just ignore the problem - software ( == boost.python ) +should not be perfect - it should work in most ( != all ) cases! + +------------ +Common |cwp| +------------ +Those names are not final and could( may be should ) be changed. + +immutable by reference +----------------------- +:: + + //function to be exported + something f( int& i, std::string& str ) + +I suppose this is very common use case. More over this use case `pyplusplus`_ +can and will treat by its own - no user action is needed. The wrapper +generated by `pyplusplus`_ will very similar to the next code: +:: + + void f_wrapper( const int& i, const std::string& str ){ + int i_out( i ); + std::string str_out( str ); + boost::python::object f_return = f( i_out, str_out ); + return boost::python::make_tuple( f_return, i, str ); + } + + +The only customization available for user is to setup argument type: +[in\|out\|in,out] + +array +----- +Arrays are a little bit different beasts. Python does not have arrays. +So, `pyplusplus`_, should implement arrays convertion: from/to C++/Python. +This is not the only difference, consider next function: +:: + + void fill( char* buffer, int index ){ + buffer[ index ] = 'c'; + } + + +There are few ways to expose this function: +:: + + ??? fill_wrapper( boost::python:list buffer, index ){ + long buffer_size = boost::python::extract<long>( buffer.attr("__len__") ); + boost::scoped_array<char> buffer_( new char[ buffer_size ] ); + for( long i = 0; i < buffer_size; ++i ){ + buffer_[ i ] = boost::python::extract<char>( buffer[i] ); + } + fill( buffer_.get(), index ); + //Now the question: how to return buffer_ to the caller? + //by constructing new list? + boost::python::list return_; + for( long i = 0; i < buffer_size; ++i ){ + return_.insert( i, buffer_[i] ); + } + return return_; + //or by modifying the buffer argument? In this case `pyplusplus`_ will + //delete all items from buffer and will copy into it items from buffer_ + //variable. + } + +Arrays size +^^^^^^^^^^^ +1. static array - size of array is known at compile time. +2. dynamic array + + + size of array is one of the function arguments + + + other ( will not be implemented in the first phase ) + + - size of array is some global/local variable + + - size of array is returned by invocation some function + + +status as exception +------------------- +There a lot of code, that returns success status and/or error description by +using one of the function arguments. It will be possible to instruct `pyplusplus`_ +to create wrapper for those functions, that will throw exception. +:: + + bool do_smth( error_description& error_desc ); + + bool do_smth_wrapper(){ + error_description error_desc; + bool return_ = do_smth( error_desc ); + if( some user code that will check that error_desc contains error ){ + throw some user code that will construct an exception from the error_desc; + } + return return_; + } + +pythread safe +------------- +Why not :-)? See next FAQ: http://boost.org/libs/python/doc/v2/faq.html#threadsupport +So, how `pyplusplus`_ can help? `pyplusplus`_ can generate exception safe code, +that will acquire and release Python global interpreter lock. + + +.. _`pyplusplus` : ./../pyplusplus.html +.. |cwp| replace:: *"call wrapper policies"* +.. _`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: Deleted: pyplusplus_dev/docs/peps/introduction.rest =================================================================== --- pyplusplus_dev/docs/peps/introduction.rest 2006-06-04 05:42:16 UTC (rev 203) +++ pyplusplus_dev/docs/peps/introduction.rest 2006-06-04 05:45:19 UTC (rev 204) @@ -1,243 +0,0 @@ -===================== -call wrapper policies -===================== - -.. contents:: Table of contents - -------------------- -What is useful for? -------------------- -Not all C++ functions could be exposed to Python as is. For example, next function -could not be exposed: -:: - - void get_size( int& size ); - -In order to expose ``get_size`` function, an user need to create next wrapper: -:: - - int get_size_wrapper( ){ - int size(0); - get_size( size ); - return size; - } - -|cwp| will provide the user with simple and intuitive way to instruct -`pyplusplus`_ to generate right wrapper. Also, it will be possible to create -a custom policies. - -This document describes what is *going to be implemented*. - --------- -Analysis --------- - -C++ function arguments usage ----------------------------- - -In C++ function argument can be used to: - -* to pass some data to function ( in ) - - there is no need to return variable from the function - -* to return some data from function ( out ) - - there is no need to force Python programmer to pass the variable as argument - to the function - -* both ( in/out ) - -Function-wrapper signature will be a little bit different in every case. - -Variable names --------------- -I think it should be possible to apply few |cwp| on a single function. -The main, ( read unresolved ) issue, is management of variable names within -function-wrapper. I see next problems, that we should solve, before proceeding -to implementation: - -1. To share variable name, between different pieces of code. - - Right now I think, that every |cwp| will have ``pre-call`` and ``post-call`` - code creators. This design will allow the user to mix few |cwp|'s within - single function-wrapper. - -2. To insure name uniqueness. - -3. To give meaningful name. - -I think, that is it very easy to solve the problem, if I remove "readability" -requirement. - -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: -http://www.boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies -:: - - //C++ code - struct Y - { - X x; Z* z; - int z_value() { return z->value(); } - }; - - X& f(Y& y, Z* z, int& error) - { - y.z = z; - return y.x; - } - - //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 -function could not be called from `Python`_. ( Hint: numbers are immutable -objects in `Python`_ ). So in order to expose function ``f`` to `Python`_, -an user need to create a wrapper. And now he has a problem: how to wrap the function? - -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 - part of the return value? - :: - - boost::tuple f_wrapper( Y& y, Z* z ){ - int error(0); - X& x = f( y, z, error ); - return boost::tuple<X&, int>( x, error ); - } - - 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 - hint? - :: - - boost::python::tuple f_wrapper( Y& y, Z* z ){ - int error(0); - X& x = f( y, z, error ); - boost::python::object x_obj( x, x is internal reference of y ); - return boost::python::make_tuple( x_obj, error ); - } - -Anyway, I think we will just ignore the problem - software ( == boost.python ) -should not be perfect - it should work in most ( != all ) cases! - ------------- -Common |cwp| ------------- -Those names are not final and could( may be should ) be changed. - -immutable by reference ------------------------ -:: - - //function to be exported - something f( int& i, std::string& str ) - -I suppose this is very common use case. More over this use case `pyplusplus`_ -can and will treat by its own - no user action is needed. The wrapper -generated by `pyplusplus`_ will very similar to the next code: -:: - - void f_wrapper( const int& i, const std::string& str ){ - int i_out( i ); - std::string str_out( str ); - boost::python::object f_return = f( i_out, str_out ); - return boost::python::make_tuple( f_return, i, str ); - } - - -The only customization available for user is to setup argument type: -[in\|out\|in,out] - -array ------ -Arrays are a little bit different beasts. Python does not have arrays. -So, `pyplusplus`_, should implement arrays convertion: from/to C++/Python. -This is not the only difference, consider next function: -:: - - void fill( char* buffer, int index ){ - buffer[ index ] = 'c'; - } - - -There are few ways to expose this function: -:: - - ??? fill_wrapper( boost::python:list buffer, index ){ - long buffer_size = boost::python::extract<long>( buffer.attr("__len__") ); - boost::scoped_array<char> buffer_( new char[ buffer_size ] ); - for( long i = 0; i < buffer_size; ++i ){ - buffer_[ i ] = boost::python::extract<char>( buffer[i] ); - } - fill( buffer_.get(), index ); - //Now the question: how to return buffer_ to the caller? - //by constructing new list? - boost::python::list return_; - for( long i = 0; i < buffer_size; ++i ){ - return_.insert( i, buffer_[i] ); - } - return return_; - //or by modifying the buffer argument? In this case `pyplusplus`_ will - //delete all items from buffer and will copy into it items from buffer_ - //variable. - } - -Arrays size -^^^^^^^^^^^ -1. static array - size of array is known at compile time. -2. dynamic array - - + size of array is one of the function arguments - - + other ( will not be implemented in the first phase ) - - - size of array is some global/local variable - - - size of array is returned by invocation some function - - -status as exception -------------------- -There a lot of code, that returns success status and/or error description by -using one of the function arguments. It will be possible to instruct `pyplusplus`_ -to create wrapper for those functions, that will throw exception. -:: - - bool do_smth( error_description& error_desc ); - - bool do_smth_wrapper(){ - error_description error_desc; - bool return_ = do_smth( error_desc ); - if( some user code that will check that error_desc contains error ){ - throw some user code that will construct an exception from the error_desc; - } - return return_; - } - -pythread safe -------------- -Why not :-)? See next FAQ: http://boost.org/libs/python/doc/v2/faq.html#threadsupport -So, how `pyplusplus`_ can help? `pyplusplus`_ can generate exception safe code, -that will acquire and release Python global interpreter lock. - - -.. _`pyplusplus` : ./../pyplusplus.html -.. |cwp| replace:: *"call wrapper policies"* -.. _`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: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:11:39
|
Revision: 209 Author: roman_yakovenko Date: 2006-06-05 02:35:05 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=209&view=rev Log Message: ----------- exception translator - just an idea Added Paths: ----------- pyplusplus_dev/unittests/cppexceptions_tester.py pyplusplus_dev/unittests/data/cppexceptions_to_be_exported.hpp Added: pyplusplus_dev/unittests/cppexceptions_tester.py =================================================================== --- pyplusplus_dev/unittests/cppexceptions_tester.py (rev 0) +++ pyplusplus_dev/unittests/cppexceptions_tester.py 2006-06-05 09:35:05 UTC (rev 209) @@ -0,0 +1,70 @@ +# 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 unittest +import fundamental_tester_base +from pyplusplus import code_creators + +TRANSLATE_CODE = \ +""" +void translate(boost::python::object py_class, cppexceptions::custom_exception_t const& e){ + std::cout << "I am here"; + boost::python::object py_custom_exception = py_class(e); + boost::python::object type = py_custom_exception.attr( "__class__" ); + PyErr_SetObject( type.ptr(), py_custom_exception.ptr() ); +} + +""" + +REGISTER_CODE = \ +""" + boost::python::object py_class = custom_exception_t_exposer; + boost::python::register_exception_translator<cppexceptions::custom_exception_t>( + boost::bind( &translate, py_class, _2 ) ); + +""" + +class tester_t(fundamental_tester_base.fundamental_tester_base_t): + EXTENSION_NAME = 'cppexceptions' + + def __init__( self, *args ): + fundamental_tester_base.fundamental_tester_base_t.__init__( + self + , tester_t.EXTENSION_NAME + , *args ) + + def customize( self, mb ): + mb.class_( 'custom_exception_t' ).add_code( REGISTER_CODE, False) + mb.build_code_creator( tester_t.EXTENSION_NAME ) + + mb.code_creator.add_include( "boost/bind.hpp" ) + mb.code_creator.add_include( "iostream" ) + translate = code_creators.custom_text_t( TRANSLATE_CODE ) + mb.code_creator.adopt_creator( translate, -1 ) + + def run_tests( self, module): + custom_exception_t = module.custom_exception_t + bases = list( custom_exception_t.__bases__ ) + [RuntimeError] + custom_exception_t.__bases__ = tuple( bases ) + custom_exception_t.__str__ = custom_exception_t.what + try: + module.throw_custom_exception() + except RuntimeError, error: + self.failUnless( str(error) == "profe of concept" ) + + + +def create_suite(): + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t)) + return suite + +def run_suite(): + unittest.TextTestRunner(verbosity=2).run( create_suite() ) + +if __name__ == "__main__": + run_suite() Added: pyplusplus_dev/unittests/data/cppexceptions_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/cppexceptions_to_be_exported.hpp (rev 0) +++ pyplusplus_dev/unittests/data/cppexceptions_to_be_exported.hpp 2006-06-05 09:35:05 UTC (rev 209) @@ -0,0 +1,32 @@ +// 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) + +#ifndef __cppexceptions_to_be_exported_hpp__ +#define __cppexceptions_to_be_exported_hpp__ + +#include <string> + +namespace cppexceptions{ + +struct custom_exception_t{ + custom_exception_t( const std::string& error ) + : m_error( error ) + {} + + const std::string& what() const{ + return m_error; + } + +private: + const std::string m_error; +}; + +inline void throw_custom_exception(){ + throw custom_exception_t( "profe of concept" ); +} + +} + +#endif//__cppexceptions_to_be_exported_hpp__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:11:10
|
Revision: 211 Author: roman_yakovenko Date: 2006-06-05 08:16:30 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=211&view=rev Log Message: ----------- incrementing version number Modified Paths: -------------- pygccxml_dev/setup.py pyplusplus_dev/setup.py Modified: pygccxml_dev/setup.py =================================================================== --- pygccxml_dev/setup.py 2006-06-05 14:09:20 UTC (rev 210) +++ pygccxml_dev/setup.py 2006-06-05 15:16:30 UTC (rev 211) @@ -51,7 +51,7 @@ setup( name = "pygccxml", - version = "0.8.0", + version = "0.8.1", description = "GCC-XML generated file reader", author = "Roman Yakovenko", author_email = "rom...@gm...", Modified: pyplusplus_dev/setup.py =================================================================== --- pyplusplus_dev/setup.py 2006-06-05 14:09:20 UTC (rev 210) +++ pyplusplus_dev/setup.py 2006-06-05 15:16:30 UTC (rev 211) @@ -85,7 +85,7 @@ setup( name = "pyplusplus", - version = "0.8.0", + version = "0.8.1", description="pyplusplus is a framework of components for creating C++ code generator for boost.python library", author="Roman Yakovenko", author_email="rom...@gm...", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:11:10
|
Revision: 212 Author: roman_yakovenko Date: 2006-06-05 08:17:25 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=212&view=rev Log Message: ----------- some fixes for vector_traits Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/type_traits.py pygccxml_dev/unittests/data/vector_traits.hpp pygccxml_dev/unittests/vector_traits_tester.py Modified: pygccxml_dev/pygccxml/declarations/type_traits.py =================================================================== --- pygccxml_dev/pygccxml/declarations/type_traits.py 2006-06-05 15:16:30 UTC (rev 211) +++ pygccxml_dev/pygccxml/declarations/type_traits.py 2006-06-05 15:17:25 UTC (rev 212) @@ -21,6 +21,7 @@ import variable import algorithm import namespace +import templates import enumeration import class_declaration from sets import Set as set @@ -210,11 +211,17 @@ return type else: return nake_type.base - + +def remove_declarated( type ): + type = remove_alias( type ) + if isinstance( type, cpptypes.declarated_t ): + type = type.declaration + return type + def is_same(type1, type2): """returns True if type1 and type2 are same types""" - nake_type1 = remove_alias( type1 ) - nake_type2 = remove_alias( type2 ) + nake_type1 = remove_declarated( type1 ) + nake_type2 = remove_declarated( type2 ) return nake_type1 == nake_type2 def is_volatile(type): @@ -793,7 +800,15 @@ if isinstance( cls, class_declaration.class_t ): return cls.typedef( "value_type" ).type else: - + value_type_str = templates.args( cls.name )[0] + found = cls.top_parent.classes( value_type_str, allow_empty=True ) + if not found: + if cpptypes.FUNDAMENTAL_TYPES.has_key( value_type_str ): + return cpptypes.FUNDAMENTAL_TYPES[value_type_str] + if len( found ) == 1: + return found[0] + else: + raise RuntimeError( "Unable to find out vector value type. vector class is: %s" % cls.decl_string ) Modified: pygccxml_dev/unittests/data/vector_traits.hpp =================================================================== --- pygccxml_dev/unittests/data/vector_traits.hpp 2006-06-05 15:16:30 UTC (rev 211) +++ pygccxml_dev/unittests/data/vector_traits.hpp 2006-06-05 15:17:25 UTC (rev 212) @@ -6,39 +6,55 @@ #include <string> #include <vector> + + struct _0_{}; + typedef std::vector< _0_ > container; + namespace vector_traits{ namespace yes{ struct _1_{ typedef int value_type; typedef std::vector< int > container; + + container do_nothing(){}; }; struct _2_{ typedef _0_ value_type; typedef std::vector< _0_ > container; + + container do_nothing(){}; }; struct _3_{ typedef std::string value_type; typedef std::vector< std::string > container; + + container do_nothing(){}; }; struct _4_{ typedef std::vector<int> value_type; typedef std::vector< std::vector<int> > container; + + container do_nothing(){}; }; struct _5_{ typedef int value_type; typedef const std::vector< int > container; + + container do_nothing(){}; }; struct _6_{ typedef const int value_type; typedef const std::vector< const int > container; + + container do_nothing(){}; }; } Modified: pygccxml_dev/unittests/vector_traits_tester.py =================================================================== --- pygccxml_dev/unittests/vector_traits_tester.py 2006-06-05 15:16:30 UTC (rev 211) +++ pygccxml_dev/unittests/vector_traits_tester.py 2006-06-05 15:17:25 UTC (rev 212) @@ -35,6 +35,16 @@ value_type = self.global_ns.class_( '_0_' ) container = self.global_ns.typedef( 'container', recursive=False ) self.validate_yes( value_type, container ) + + def test_yes( self ): + yes_ns = self.global_ns.namespace( 'yes' ) + for struct in yes_ns.classes(): + if not struct.name.startswith( '_' ): + continue + if not struct.name.endswith( '_' ): + continue + self.validate_yes( struct.typedef( 'value_type' ) + , struct.typedef( 'container' ) ) def create_suite(): suite = unittest.TestSuite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:11:03
|
Revision: 214 Author: roman_yakovenko Date: 2006-06-05 12:01:29 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=214&view=rev Log Message: ----------- fixing bug: functions with more then 10 arguments could be exported, BOOST_PYTHON_MAX_ARITY define should be adjusted Modified Paths: -------------- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2006-06-05 18:36:16 UTC (rev 213) +++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2006-06-05 19:01:29 UTC (rev 214) @@ -6,7 +6,7 @@ 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): @@ -97,7 +97,11 @@ def _exportable_impl( self ): #see http://www.boost.org/libs/python/doc/v2/faq.html#funcptr if len( self.arguments ) > 10: - return "boost.python can not expose function with more then 10 arguments. ( impl details: boost.tuple is limited to 10 args )." + msg = "You have function 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 % len( self.arguments ) ) + all_types = [ arg.type for arg in self.arguments ] all_types.append( self.return_type ) for some_type in all_types: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:11:00
|
Revision: 215 Author: roman_yakovenko Date: 2006-06-05 12:49:29 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=215&view=rev Log Message: ----------- adding indexing suite and few type traits for it Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/type_traits.py Added Paths: ----------- pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite.py Modified: pygccxml_dev/pygccxml/declarations/type_traits.py =================================================================== --- pygccxml_dev/pygccxml/declarations/type_traits.py 2006-06-05 19:01:29 UTC (rev 214) +++ pygccxml_dev/pygccxml/declarations/type_traits.py 2006-06-05 19:49:29 UTC (rev 215) @@ -731,27 +731,27 @@ return __is_noncopyable_single( class_ ) -def is_defined_in_std( cls ): +def is_defined_in_xxx( xxx, cls ): if not cls.parent: return False if not isinstance( cls.parent, namespace.namespace_t ): return False - if 'std' != cls.parent.name: + if xxx != cls.parent.name: return False - std = cls.parent - if not std.parent: + xxx_ns = cls.parent + if not xxx_ns.parent: return False - if not isinstance( std.parent, namespace.namespace_t ): + if not isinstance( xxx_ns.parent, namespace.namespace_t ): return False - if '::' != std.parent.name: + if '::' != xxx_ns.parent.name: return False - global_ns = std.parent + global_ns = xxx_ns.parent return None is global_ns.parent class vector_traits: @@ -772,7 +772,7 @@ if not cls.name.startswith( 'vector<' ): return - if not is_defined_in_std( cls ): + if not is_defined_in_xxx( 'std', cls ): return return cls @@ -810,6 +810,32 @@ else: raise RuntimeError( "Unable to find out vector value type. vector class is: %s" % cls.decl_string ) +def is_smart_pointer( type ): + type = remove_alias( type ) + type = remove_cv( type ) + if not is_defined_in_xxx( 'boost', type ): + return False + return type.decl_string.startswith( '::boost::shared_ptr<' ) + +def is_std_string( type ): + decl_strings = [ + '::std::basic_string<char,std::char_traits<char>,std::allocator<char> >' + , '::std::basic_string<char, std::char_traits<char>, std::allocator<char> >' + , '::std::string' ] + type = remove_alias( type ) + return remove_cv( type ).decl_string in decl_strings + +def is_std_wstring( type ): + decl_strings = [ + '::std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >' + , '::std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >' + , '::std::wstring' ] + type = remove_alias( type ) + return remove_cv( type ).decl_string in decl_strings + + + + Added: pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite.py (rev 0) +++ pyplusplus_dev/pyplusplus/decl_wrappers/indexing_suite.py 2006-06-05 19:49:29 UTC (rev 215) @@ -0,0 +1,39 @@ +# 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) + +from pygccxml import declarations + +#NoProxy +#By default indexed elements have Python reference semantics and are returned by +#proxy. This can be disabled by supplying true in the NoProxy template parameter. +#When we want to disable is: +#1. We deal with immutable objects: +# 1. fundamental types +# 2. enum type +# 3. std::[w]string +# 4. std::complex +# 5. shared_ptr + +class indexing_suite_t( object ): + def __init__( self, no_proxy=None, derived_policies=None ): + object.__init__( self ) + self.__no_proxy = no_proxy + self.__derived_policies = None + + def value_type(self): + raise NotImplementedError() + + def _get_no_proxy( self ): + if self.__no_proxy is None: + value_type = self.value_type() + if declaration.is_fundamental( value_type ): + self.__no_proxy = True + elif declarations.is_enum( value_type ): + self.__no_proxy = True + + + + + \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:10:45
|
Revision: 213 Author: roman_yakovenko Date: 2006-06-05 11:36:16 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=213&view=rev Log Message: ----------- fixing vector traits tester Modified Paths: -------------- pygccxml_dev/unittests/data/vector_traits.hpp pygccxml_dev/unittests/test_all.py pygccxml_dev/unittests/vector_traits_tester.py Modified: pygccxml_dev/unittests/data/vector_traits.hpp =================================================================== --- pygccxml_dev/unittests/data/vector_traits.hpp 2006-06-05 15:17:25 UTC (rev 212) +++ pygccxml_dev/unittests/data/vector_traits.hpp 2006-06-05 18:36:16 UTC (rev 213) @@ -49,13 +49,6 @@ container do_nothing(){}; }; - - struct _6_{ - typedef const int value_type; - typedef const std::vector< const int > container; - - container do_nothing(){}; - }; } Modified: pygccxml_dev/unittests/test_all.py =================================================================== --- pygccxml_dev/unittests/test_all.py 2006-06-05 15:17:25 UTC (rev 212) +++ pygccxml_dev/unittests/test_all.py 2006-06-05 18:36:16 UTC (rev 213) @@ -34,6 +34,7 @@ import typedefs_tester import demangled_tester import unnamed_enums_bug_tester +import vector_traits_tester def create_suite(): testers = [ @@ -67,6 +68,7 @@ , typedefs_tester , demangled_tester , unnamed_enums_bug_tester + , vector_traits_tester ] main_suite = unittest.TestSuite() Modified: pygccxml_dev/unittests/vector_traits_tester.py =================================================================== --- pygccxml_dev/unittests/vector_traits_tester.py 2006-06-05 15:17:25 UTC (rev 212) +++ pygccxml_dev/unittests/vector_traits_tester.py 2006-06-05 18:36:16 UTC (rev 213) @@ -45,7 +45,17 @@ continue self.validate_yes( struct.typedef( 'value_type' ) , struct.typedef( 'container' ) ) - + + def test_no( self ): + traits = declarations.vector_traits + no_ns = self.global_ns.namespace( 'no' ) + for struct in no_ns.classes(): + if not struct.name.startswith( '_' ): + continue + if not struct.name.endswith( '_' ): + continue + self.failUnless( not traits.is_vector( struct.typedef( 'container' ) ) ) + 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-06-07 20:10:19
|
Revision: 210 Author: roman_yakovenko Date: 2006-06-05 07:09:20 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=210&view=rev Log Message: ----------- adding is_vector type traits Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/__init__.py pygccxml_dev/pygccxml/declarations/type_traits.py Added Paths: ----------- pygccxml_dev/unittests/data/unnamed_classes.hpp pygccxml_dev/unittests/data/vector_traits.hpp pygccxml_dev/unittests/unnamed_classes_tester.py pygccxml_dev/unittests/vector_traits_tester.py Modified: pygccxml_dev/pygccxml/declarations/__init__.py =================================================================== --- pygccxml_dev/pygccxml/declarations/__init__.py 2006-06-05 09:35:05 UTC (rev 209) +++ pygccxml_dev/pygccxml/declarations/__init__.py 2006-06-05 14:09:20 UTC (rev 210) @@ -142,6 +142,8 @@ from type_traits import find_trivial_constructor from type_traits import has_any_non_copyconstructor +from type_traits import vector_traits + import templates import call_invocation Modified: pygccxml_dev/pygccxml/declarations/type_traits.py =================================================================== --- pygccxml_dev/pygccxml/declarations/type_traits.py 2006-06-05 09:35:05 UTC (rev 209) +++ pygccxml_dev/pygccxml/declarations/type_traits.py 2006-06-05 14:09:20 UTC (rev 210) @@ -20,6 +20,7 @@ import cpptypes import variable import algorithm +import namespace import enumeration import class_declaration from sets import Set as set @@ -721,14 +722,84 @@ return True return __is_noncopyable_single( class_ ) + + +def is_defined_in_std( cls ): + if not cls.parent: + return False + if not isinstance( cls.parent, namespace.namespace_t ): + return False + if 'std' != cls.parent.name: + return False + + std = cls.parent + if not std.parent: + return False + if not isinstance( std.parent, namespace.namespace_t ): + return False + if '::' != std.parent.name: + return False + global_ns = std.parent + return None is global_ns.parent + +class vector_traits: + + @staticmethod + def declaration_or_none( type ): + global is_defined_in_std + """returns reference to the class declaration or None""" + type = remove_alias( type ) + type = remove_cv( type ) + if not isinstance( type, cpptypes.declarated_t ): + return + + cls = remove_alias( type.declaration ) + if not isinstance( cls, ( class_declaration.class_t, class_declaration.class_declaration_t ) ): + return + + if not cls.name.startswith( 'vector<' ): + return + + if not is_defined_in_std( cls ): + return + return cls + + @staticmethod + def is_vector( type ): + """ + Returns True if type represents instantiation of std class vector, + otherwise False. + """ + return not( None is vector_traits.declaration_or_none( type ) ) + + @staticmethod + def class_declaration( type ): + """returns reference to the class declaration, """ + cls = vector_traits.declaration_or_none( type ) + if not cls: + raise TypeError( 'Type "%s" is not instantiation ov std::vector' % type.decl_string ) + return cls + @staticmethod + def value_type( type ): + """returns reference to value_type of the vector""" + cls = vector_traits.class_declaration( type ) + if isinstance( cls, class_declaration.class_t ): + return cls.typedef( "value_type" ).type + else: + + + + + + \ No newline at end of file Added: pygccxml_dev/unittests/data/unnamed_classes.hpp =================================================================== --- pygccxml_dev/unittests/data/unnamed_classes.hpp (rev 0) +++ pygccxml_dev/unittests/data/unnamed_classes.hpp 2006-06-05 14:09:20 UTC (rev 210) @@ -0,0 +1,51 @@ +// 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) + +#ifndef __unnamed_classes_hpp__ +#define __unnamed_classes_hpp__ + +namespace unnamed{ + +struct S1{ + struct S2{ + union Flags{ + struct{ + unsigned int hasItemIdList : 1; + unsigned int pointsToFileOrDir : 1; + unsigned int hasDescription : 1; + unsigned int hasRelativePath : 1; + unsigned int hasWorkingDir : 1; + unsigned int hasCmdLineArgs : 1; + unsigned int hasCustomIcon : 1; + unsigned int useWorkingDir : 1; // Seems to need to be set to enable working dir + unsigned int unused : 24; + }; + unsigned int raw; + } flags; + + union FileAttribs{ + struct{ + unsigned int isReadOnly : 1; + unsigned int isHidden : 1; + unsigned int isSystem : 1; + unsigned int isVolumeLabel : 1; + unsigned int isDir : 1; + unsigned int isModified : 1; // =archive bit set, ie; is a file normally + unsigned int isEncrypted : 1; + unsigned int isNormal : 1; // Doesn't seem to get set + unsigned int isTemporary : 1; + unsigned int isSparse : 1; + unsigned int hasReparsePoint : 1; + unsigned int isCompressed : 1; + unsigned int isOffline : 1; + unsigned int unused : 19; + }; + unsigned int raw; + } fileattribs; // in GetFileAttributes() format + } header; +}; + +} // namespace +#endif//__unnamed_classes_hpp__ Added: pygccxml_dev/unittests/data/vector_traits.hpp =================================================================== --- pygccxml_dev/unittests/data/vector_traits.hpp (rev 0) +++ pygccxml_dev/unittests/data/vector_traits.hpp 2006-06-05 14:09:20 UTC (rev 210) @@ -0,0 +1,59 @@ +// 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) + +#include <string> +#include <vector> + +struct _0_{}; +typedef std::vector< _0_ > container; + +namespace vector_traits{ +namespace yes{ + struct _1_{ + typedef int value_type; + typedef std::vector< int > container; + }; + + struct _2_{ + typedef _0_ value_type; + typedef std::vector< _0_ > container; + }; + + struct _3_{ + typedef std::string value_type; + typedef std::vector< std::string > container; + }; + + struct _4_{ + typedef std::vector<int> value_type; + typedef std::vector< std::vector<int> > container; + }; + + struct _5_{ + typedef int value_type; + typedef const std::vector< int > container; + }; + + struct _6_{ + typedef const int value_type; + typedef const std::vector< const int > container; + }; + +} + +namespace no{ + struct _1_{ + template< class T > + struct vector{}; + + typedef vector<int> container; + }; + + struct _2_{ + typedef const std::vector< const int >& container; + }; +} + +} \ No newline at end of file Added: pygccxml_dev/unittests/unnamed_classes_tester.py =================================================================== --- pygccxml_dev/unittests/unnamed_classes_tester.py (rev 0) +++ pygccxml_dev/unittests/unnamed_classes_tester.py 2006-06-05 14:09:20 UTC (rev 210) @@ -0,0 +1,40 @@ +# 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 unittest +import autoconfig +import parser_test_case + +from pygccxml import utils +from pygccxml import parser +from pygccxml import declarations + +class tester_t( parser_test_case.parser_test_case_t ): + def __init__(self, *args ): + parser_test_case.parser_test_case_t.__init__( self, *args ) + self.header = 'unnamed_classes.hpp' + self.global_ns = None + + def setUp(self): + if not self.global_ns: + decls = parser.parse( [self.header], self.config ) + self.global_ns = declarations.get_global_namespace( decls ) + self.global_ns.init_optimizer() + + def test( self ): + #bf_x = self.global_ns.variable( 'x' ) + #self.failUnless( bf_x.bits == 1 ) + pass + +def create_suite(): + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t)) + return suite + +def run_suite(): + unittest.TextTestRunner(verbosity=2).run( create_suite() ) + +if __name__ == "__main__": + run_suite() \ No newline at end of file Added: pygccxml_dev/unittests/vector_traits_tester.py =================================================================== --- pygccxml_dev/unittests/vector_traits_tester.py (rev 0) +++ pygccxml_dev/unittests/vector_traits_tester.py 2006-06-05 14:09:20 UTC (rev 210) @@ -0,0 +1,48 @@ +# 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 unittest +import autoconfig +import parser_test_case + +from pygccxml import utils +from pygccxml import parser +from pygccxml import declarations + +class tester_t( parser_test_case.parser_test_case_t ): + COMPILATION_MODE = parser.COMPILATION_MODE.ALL_AT_ONCE + global_ns = None + def __init__(self, *args ): + parser_test_case.parser_test_case_t.__init__( self, *args ) + self.header = 'vector_traits.hpp' + self.global_ns = None + + def setUp(self): + if not tester_t.global_ns: + decls = parser.parse( [self.header], self.config ) + tester_t.global_ns = declarations.get_global_namespace( decls ) + self.global_ns = tester_t.global_ns + + def validate_yes( self, value_type, container ): + traits = declarations.vector_traits + self.failUnless( traits.declaration_or_none( container ) ) + self.failUnless( traits.is_vector( container ) ) + self.failUnless( declarations.is_same( value_type, traits.value_type( container ) ) ) + + def test_global_ns( self ): + value_type = self.global_ns.class_( '_0_' ) + container = self.global_ns.typedef( 'container', recursive=False ) + self.validate_yes( value_type, container ) + +def create_suite(): + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t)) + return suite + +def run_suite(): + unittest.TextTestRunner(verbosity=2).run( create_suite() ) + +if __name__ == "__main__": + run_suite() \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:09:34
|
Revision: 208 Author: roman_yakovenko Date: 2006-06-04 20:57:03 -0700 (Sun, 04 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=208&view=rev Log Message: ----------- updating examples Modified Paths: -------------- pyplusplus_dev/examples/custom_code_creator/generate_code.py pyplusplus_dev/examples/custom_code_creator/sconstruct pyplusplus_dev/examples/pyboost_dev/sconstruct Added Paths: ----------- pyplusplus_dev/examples/custom_code_creator/generated/properties.py.cpp Removed Paths: ------------- pyplusplus_dev/examples/custom_code_creator/environment.py Deleted: pyplusplus_dev/examples/custom_code_creator/environment.py =================================================================== --- pyplusplus_dev/examples/custom_code_creator/environment.py 2006-06-05 03:36:47 UTC (rev 207) +++ pyplusplus_dev/examples/custom_code_creator/environment.py 2006-06-05 03:57:03 UTC (rev 208) @@ -1,57 +0,0 @@ -#! /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 sys - -class settings: - module_name = 'properties' - boost_path = '' - boost_libs_path = '' - gccxml_path = '' - pygccxml_path = '' - pyplusplus_path = '' - sources_path = '' - python_libs_path = '' - python_include_path = '' - working_dir = '' - generated_files_dir = '' - unittests_dir = '' - - 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' - settings.boost_libs_path = '/home/roman/boost_cvs/bin' - settings.gccxml_path = '/home/roman/gccxml/bin/gccxml' - settings.pygccxml_path = '/home/roman/pygccxml_sources/source' - settings.pyplusplus_path = '/home/roman/pygccxml_sources/source' - settings.python_include_path = '/usr/include/python2.3' - - settings.sources_path = '/home/roman/pygccxml_sources/source/pyplusplus/examples/custom_code_creator' - settings.working_dir = '/home/roman/pygccxml_sources/source/pyplusplus/examples/custom_code_creator' - settings.generated_files_dir = '/home/roman/pygccxml_sources/source/pyplusplus/examples/custom_code_creator/generated' - settings.unittests_dir = '/home/roman/pygccxml_sources/source/pyplusplus/examples/custom_code_creator/unittests' -elif sys.platform == 'win32': - settings.boost_path = 'd:/boost_cvs' - settings.boost_libs_path = 'd:/boost_cvs/bin' - settings.gccxml_path = 'c:/tools/gcc_xml/bin' - settings.pygccxml_path = 'd:/pygccxml_sources/source' - settings.pyplusplus_path = 'd:/pygccxml_sources/source' - settings.python_libs_path = 'c:/python/libs' - settings.python_include_path = 'c:/python/include' - - settings.sources_path = 'd:/pygccxml_sources/source/pyplusplus/examples/custom_code_creator' - settings.working_dir = 'd:/pygccxml_sources/source/pyplusplus/examples/custom_code_creator' - settings.generated_files_dir = 'd:/pygccxml_sources/source/pyplusplus/examples/custom_code_creator/generated' - settings.unittests_dir = 'd:/pygccxml_sources/source/pyplusplus/examples/custom_code_creator/unittests' - -else: - raise RuntimeError( 'There is no configuration for "%s" platform.' % sys.platform ) - -settings.setup_environment() \ No newline at end of file Modified: pyplusplus_dev/examples/custom_code_creator/generate_code.py =================================================================== --- pyplusplus_dev/examples/custom_code_creator/generate_code.py 2006-06-05 03:36:47 UTC (rev 207) +++ pyplusplus_dev/examples/custom_code_creator/generate_code.py 2006-06-05 03:57:03 UTC (rev 208) @@ -16,8 +16,10 @@ reference to parent code creator ( we can safely omit this argument ) """ -import os -from environment import settings +import os +import sys +sys.path.append( '../..' ) +from environment import gccxml from pygccxml import declarations from pyplusplus import code_creators from pyplusplus import module_builder @@ -71,14 +73,14 @@ prop_creator = property_creator_t( get_creator.declaration, set_creator.declaration ) class_creator.adopt_creator( prop_creator ) -if __name__ == '__main__': +if __name__ == '__main__': + module_name = 'properties' #1. creating module builder - mb = module_builder.module_builder_t( files=['properties.hpp'] - , gccxml_path=settings.gccxml_path - , working_directory=settings.sources_path ) + mb = module_builder.module_builder_t( files=['properties.hpp'] + , gccxml_path=gccxml.executable ) #2. creating module code creator - mb.build_code_creator( module_name=settings.module_name ) - mb.code_creator.user_defined_directories.append( settings.working_dir ) + mb.build_code_creator( module_name=module_name ) + mb.code_creator.user_defined_directories.append( os.path.abspath( '.' ) ) #3. replacing get/set code creators with property code creator classes = filter( lambda creator: isinstance( creator, code_creators.class_t ) @@ -86,6 +88,6 @@ map( replace_functions, classes ) #4. writing module to disk - mb.write_module( os.path.join( settings.generated_files_dir, settings.module_name + '.py.cpp') ) + mb.write_module( os.path.join( os.path.abspath( '.' ), 'generated', module_name + '.py.cpp') ) print 'done' \ No newline at end of file Added: pyplusplus_dev/examples/custom_code_creator/generated/properties.py.cpp =================================================================== --- pyplusplus_dev/examples/custom_code_creator/generated/properties.py.cpp (rev 0) +++ pyplusplus_dev/examples/custom_code_creator/generated/properties.py.cpp 2006-06-05 03:57:03 UTC (rev 208) @@ -0,0 +1,23 @@ +// This file has been generated by pyplusplus. + +#include "boost/python.hpp" + +#include "properties.hpp" + +namespace bp = boost::python; + +BOOST_PYTHON_MODULE(properties){ + bp::class_< geometry::point_t >( "point_t", bp::init< bp::optional< int, int > >(( bp::arg("x")=0, bp::arg("y")=0 ))[bp::default_call_policies()] ) + .add_property( "y", &::geometry::point_t::get_y, &::geometry::point_t::set_y ) + .add_property( "x", &::geometry::point_t::get_x, &::geometry::point_t::set_x ); + + bp::def("extract_y" + , &::geometry::extract_y + , ( bp::arg("pt") ) + , bp::default_call_policies() ); + + bp::def("extract_x" + , &::geometry::extract_x + , ( bp::arg("pt") ) + , bp::default_call_policies() ); +} Modified: pyplusplus_dev/examples/custom_code_creator/sconstruct =================================================================== --- pyplusplus_dev/examples/custom_code_creator/sconstruct 2006-06-05 03:36:47 UTC (rev 207) +++ pyplusplus_dev/examples/custom_code_creator/sconstruct 2006-06-05 03:57:03 UTC (rev 208) @@ -3,35 +3,27 @@ # 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 -from environment import settings +import sys +sys.path.append( './../..' ) +import environment -def get_shlibsuffix(): - if sys.platform == 'win32': - return '.pyd' - else: - return '.so' +env = Environment( + LIBS=['boost_python'] + , LIBPATH=[ environment.boost.libs, environment.python.libs ] + , CPPPATH=[ environment.boost.include, environment.python.include, '#.' ] + , SHLIBPREFIX='' + , SHLIBSUFFIX=environment.scons.suffix +) + +if sys.platform == 'win32': + env.Replace( no_import_lib=1 ) + env.Append( CCFLAGS='/EHsc' ) +else: + env.Append( CCFLAGS=' -Os -fPIC -fvisibility=hidden' ) -def get_ccflags(): - if sys.platform == 'win32': - return ['/MD', '/EHsc' , '/GR' ] - else: - return [] - -def get_target(): - return os.path.join( settings.unittests_dir, settings.module_name + get_shlibsuffix() ) - -SharedLibrary( target=get_target() - , source=[ 'generated/properties.py.cpp' ] - , LIBS=[ 'boost_python', ] - , LIBPATH=[ settings.boost_libs_path, settings.python_libs_path ] - , CPPPATH=[ settings.boost_path - , settings.working_dir - , settings.sources_path - , settings.python_include_path ] - , CCFLAGS=get_ccflags() - , SHLIBPREFIX='' - , SHLIBSUFFIX=get_shlibsuffix() -) +properties = env.SharedLibrary( target='properties' + , source=[ 'generated/properties.py.cpp' ] ) + +env.Install( '#unittests', properties ) \ No newline at end of file Modified: pyplusplus_dev/examples/pyboost_dev/sconstruct =================================================================== --- pyplusplus_dev/examples/pyboost_dev/sconstruct 2006-06-05 03:36:47 UTC (rev 207) +++ pyplusplus_dev/examples/pyboost_dev/sconstruct 2006-06-05 03:57:03 UTC (rev 208) @@ -18,6 +18,7 @@ if sys.platform == 'win32': env.Replace( no_import_lib=1 ) + env.Append( CCFLAGS='/EHsc' ) else: env.Append( CCFLAGS=' -Os -fPIC -fvisibility=hidden' ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:09:29
|
Revision: 207 Author: roman_yakovenko Date: 2006-06-04 20:36:47 -0700 (Sun, 04 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=207&view=rev Log Message: ----------- updating examples Modified Paths: -------------- pyplusplus_dev/docs/tutorials/module_builder/generate_code.html pyplusplus_dev/docs/tutorials/module_builder/result.html pyplusplus_dev/tutorials/module_builder/generate_code.py pyplusplus_dev/tutorials/module_builder/hello_world.py.cpp Removed Paths: ------------- pyplusplus_dev/tutorials/module_builder/environment.py Modified: pyplusplus_dev/docs/tutorials/module_builder/generate_code.html =================================================================== --- pyplusplus_dev/docs/tutorials/module_builder/generate_code.html 2006-06-04 18:49:56 UTC (rev 206) +++ pyplusplus_dev/docs/tutorials/module_builder/generate_code.html 2006-06-05 03:36:47 UTC (rev 207) @@ -50,13 +50,14 @@ <span class="S1"># http://www.boost.org/LICENSE_1_0.txt)</span><br /> <br /> <span class="S5">import</span><span class="S0"> </span>os<br /> -<span class="S5">from</span><span class="S0"> </span>environment<span class="S0"> </span><span class="S5">import</span><span class="S0"> </span>settings<br /> +<span class="S5">import</span><span class="S0"> </span>sys<br /> +sys<span class="S10">.</span>path<span class="S10">.</span>append<span class="S10">(</span><span class="S0"> </span><span class="S4">'../..'</span><span class="S0"> </span><span class="S10">)</span><br /> +<span class="S5">from</span><span class="S0"> </span>environment<span class="S0"> </span><span class="S5">import</span><span class="S0"> </span>gccxml<br /> <span class="S5">from</span><span class="S0"> </span>pyplusplus<span class="S0"> </span><span class="S5">import</span><span class="S0"> </span>module_builder<br /> <br /> mb<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>module_builder<span class="S10">.</span>module_builder_t<span class="S10">(</span><br /> <span class="S0"> </span>files<span class="S10">=[</span><span class="S4">'hello_world.hpp'</span><span class="S10">]</span><br /> -<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span>gccxml_path<span class="S10">=</span>settings<span class="S10">.</span>gccxml_path<span class="S0"> </span><span class="S1">#path to gccxml executable</span><br /> -<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span>working_directory<span class="S10">=</span>settings<span class="S10">.</span>working_dir<span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><span class="S1">#setting working directory for gccxml</span><br /> +<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span>gccxml_path<span class="S10">=</span>gccxml<span class="S10">.</span>executable<span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><span class="S1">#path to gccxml executable</span><br /> <br /> <span class="S1">#rename enum Color to color</span><br /> Color<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>mb<span class="S10">.</span>enum<span class="S10">(</span><span class="S0"> </span><span class="S4">'color'</span><span class="S0"> </span><span class="S10">)</span><br /> @@ -92,9 +93,9 @@ mb<span class="S10">.</span>code_creator<span class="S10">.</span>license<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">'//Boost Software License( http://boost.org/more/license_info.html )'</span><br /> <br /> <span class="S1">#I don't want absolute includes within code</span><br /> -mb<span class="S10">.</span>code_creator<span class="S10">.</span>user_defined_directories<span class="S10">.</span>append<span class="S10">(</span><span class="S0"> </span>settings<span class="S10">.</span>working_dir<span class="S0"> </span><span class="S10">)</span><br /> +mb<span class="S10">.</span>code_creator<span class="S10">.</span>user_defined_directories<span class="S10">.</span>append<span class="S10">(</span><span class="S0"> </span>os<span class="S10">.</span>path<span class="S10">.</span>abspath<span class="S10">(</span><span class="S4">'.'</span><span class="S10">)</span><span class="S0"> </span><span class="S10">)</span><br /> <br /> <span class="S1">#And finally we can write code to the disk</span><br /> -mb<span class="S10">.</span>write_module<span class="S10">(</span><span class="S0"> </span>os<span class="S10">.</span>path<span class="S10">.</span>join<span class="S10">(</span><span class="S0"> </span>settings<span class="S10">.</span>working_dir<span class="S10">,</span><span class="S0"> </span><span class="S4">'hello_world.py.cpp'</span><span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><span class="S10">)</span></span> +mb<span class="S10">.</span>write_module<span class="S10">(</span><span class="S0"> </span>os<span class="S10">.</span>path<span class="S10">.</span>join<span class="S10">(</span><span class="S0"> </span>os<span class="S10">.</span>path<span class="S10">.</span>abspath<span class="S10">(</span><span class="S4">'.'</span><span class="S10">),</span><span class="S0"> </span><span class="S4">'hello_world.py.cpp'</span><span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><span class="S10">)</span></span> </body> </html> Modified: pyplusplus_dev/docs/tutorials/module_builder/result.html =================================================================== --- pyplusplus_dev/docs/tutorials/module_builder/result.html 2006-06-04 18:49:56 UTC (rev 206) +++ pyplusplus_dev/docs/tutorials/module_builder/result.html 2006-06-05 03:36:47 UTC (rev 207) @@ -49,9 +49,6 @@ <br /> <span class="S2">//Boost Software License( http://boost.org/more/license_info.html )</span><br /> <br /> -<span class="S2">// std directories: []</span><br /> -<span class="S2">// user defined directories: ['d:\\pygccxml_sources\\source\\pyplusplus\\examples\\tutorials']</span><br /> -<br /> <span class="S9">#include "boost/python.hpp"</span><br /> <br /> <span class="S9">#include "hello_world.hpp"</span><br /> @@ -66,12 +63,12 @@ <span class="S0"> </span><span class="S10">.</span>export_values<span class="S10">()</span><br /> <span class="S0"> </span><span class="S10">;</span><br /> <br /> -<span class="S0"> </span>bp<span class="S10">::</span>class_<span class="S10"><</span><span class="S0"> </span>animal<span class="S0"> </span><span class="S10">>(</span><span class="S0"> </span><span class="S6">"animal"</span><span class="S10">,</span><span class="S0"> </span>bp<span class="S10">::</span>init<span class="S10"><</span><span class="S0"> </span>bp<span class="S10">::</span>optional<span class="S10"><</span><span class="S0"> </span>std<span class="S10">::</span>string<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S10">&</span><span class="S0"> </span><span class="S10">></span><span class="S0"> </span><span class="S10">>((</span><span class="S0"> </span>bp<span class="S10">::</span>arg<span class="S10">(</span><span class="S6">"name"</span><span class="S10">)=</span><span class="S6">""</span><span class="S0"> </span><span class="S10">))</span><span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><br /> -<span class="S0"> </span><span class="S10">.</span>def<span class="S10">(</span><span class="S0"> </span><span class="S6">"get_name_ptr"</span><br /> -<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span><span class="S10">&</span>animal<span class="S10">::</span>get_name_ptr<br /> +<span class="S0"> </span>bp<span class="S10">::</span>class_<span class="S10"><</span><span class="S0"> </span>animal<span class="S10">,</span><span class="S0"> </span>boost<span class="S10">::</span>noncopyable<span class="S0"> </span><span class="S10">>(</span><span class="S0"> </span><span class="S6">"animal"</span><span class="S10">,</span><span class="S0"> </span>bp<span class="S10">::</span>init<span class="S10"><</span><span class="S0"> </span>bp<span class="S10">::</span>optional<span class="S10"><</span><span class="S0"> </span>std<span class="S10">::</span>string<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S10">&</span><span class="S0"> </span><span class="S10">></span><span class="S0"> </span><span class="S10">>((</span><span class="S0"> </span>bp<span class="S10">::</span>arg<span class="S10">(</span><span class="S6">"name"</span><span class="S10">)=</span><span class="S6">""</span><span class="S0"> </span><span class="S10">))</span><span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><br /> +<span class="S0"> </span><span class="S10">.</span>def<span class="S10">(</span><span class="S6">"get_name_ptr"</span><br /> +<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span><span class="S10">&::</span>animal<span class="S10">::</span>get_name_ptr<br /> <span class="S0"> </span><span class="S10">,</span><span class="S0"> </span>bp<span class="S10">::</span>return_internal_reference<span class="S10"><</span><span class="S0"> </span><span class="S4">1</span><span class="S10">,</span><span class="S0"> </span>bp<span class="S10">::</span>default_call_policies<span class="S0"> </span><span class="S10">>()</span><span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><br /> -<span class="S0"> </span><span class="S10">.</span>def<span class="S10">(</span><span class="S0"> </span><span class="S6">"name"</span><br /> -<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span><span class="S10">&</span>animal<span class="S10">::</span>name<br /> +<span class="S0"> </span><span class="S10">.</span>def<span class="S10">(</span><span class="S6">"name"</span><br /> +<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span><span class="S10">&::</span>animal<span class="S10">::</span>name<br /> <span class="S0"> </span><span class="S10">,</span><span class="S0"> </span>bp<span class="S10">::</span>return_value_policy<span class="S10"><</span><span class="S0"> </span>bp<span class="S10">::</span>copy_const_reference<span class="S10">,</span><span class="S0"> </span>bp<span class="S10">::</span>default_call_policies<span class="S0"> </span><span class="S10">>()</span><span class="S0"> </span><span class="S10">);</span><br /> <br /> <span class="S0"> </span>bp<span class="S10">::</span>implicitly_convertible<span class="S10"><</span><span class="S0"> </span>std<span class="S10">::</span>string<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S10">&,</span><span class="S0"> </span>animal<span class="S0"> </span><span class="S10">>();</span><br /> Deleted: pyplusplus_dev/tutorials/module_builder/environment.py =================================================================== --- pyplusplus_dev/tutorials/module_builder/environment.py 2006-06-04 18:49:56 UTC (rev 206) +++ pyplusplus_dev/tutorials/module_builder/environment.py 2006-06-05 03:36:47 UTC (rev 207) @@ -1,29 +0,0 @@ -#! /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 sys - -class settings: - gccxml_path = '' - pygccxml_path = '' - pyplusplus_path = '' - working_dir = '' - - if sys.platform == 'linux2': - gccxml_path = '/home/roman/gccxml/bin/gccxml' - pygccxml_path = '/home/roman/pygccxml_sources/source' - pyplusplus_path = '/home/roman/pygccxml_sources/source' - working_dir = '/home/roman/pygccxml_sources/source/pyplusplus/examples/tutorials' - elif sys.platform == 'win32': - gccxml_path = 'c:/tools/gcc_xml/bin' - pygccxml_path = 'd:/pygccxml_sources/source' - pyplusplus_path = 'd:/pygccxml_sources/source' - working_dir = 'd:/pygccxml_sources/source/pyplusplus/examples/tutorials' - else: - raise RuntimeError( 'There is no configuration for "%s" platform.' % sys.platform ) - -sys.path.append( settings.pygccxml_path ) -sys.path.append( settings.pyplusplus_path ) Modified: pyplusplus_dev/tutorials/module_builder/generate_code.py =================================================================== --- pyplusplus_dev/tutorials/module_builder/generate_code.py 2006-06-04 18:49:56 UTC (rev 206) +++ pyplusplus_dev/tutorials/module_builder/generate_code.py 2006-06-05 03:36:47 UTC (rev 207) @@ -11,13 +11,14 @@ ############################################################################# import os -from environment import settings +import sys +sys.path.append( '../..' ) +from environment import gccxml from pyplusplus import module_builder mb = module_builder.module_builder_t( files=['hello_world.hpp'] - , gccxml_path=settings.gccxml_path #path to gccxml executable - , working_directory=settings.working_dir ) #setting working directory for gccxml + , gccxml_path=gccxml.executable ) #path to gccxml executable #rename enum Color to color Color = mb.enum( 'color' ) @@ -53,7 +54,7 @@ mb.code_creator.license = '//Boost Software License( http://boost.org/more/license_info.html )' #I don't want absolute includes within code -mb.code_creator.user_defined_directories.append( settings.working_dir ) +mb.code_creator.user_defined_directories.append( os.path.abspath('.') ) #And finally we can write code to the disk -mb.write_module( os.path.join( settings.working_dir, 'hello_world.py.cpp' ) ) \ No newline at end of file +mb.write_module( os.path.join( os.path.abspath('.'), 'hello_world.py.cpp' ) ) \ No newline at end of file Modified: pyplusplus_dev/tutorials/module_builder/hello_world.py.cpp =================================================================== --- pyplusplus_dev/tutorials/module_builder/hello_world.py.cpp 2006-06-04 18:49:56 UTC (rev 206) +++ pyplusplus_dev/tutorials/module_builder/hello_world.py.cpp 2006-06-05 03:36:47 UTC (rev 207) @@ -2,9 +2,6 @@ //Boost Software License( http://boost.org/more/license_info.html ) -// std directories: [] -// user defined directories: ['d:\\pygccxml_sources\\source\\pyplusplus\\examples\\tutorials'] - #include "boost/python.hpp" #include "hello_world.hpp" @@ -19,12 +16,12 @@ .export_values() ; - bp::class_< animal >( "animal", bp::init< bp::optional< std::string const & > >(( bp::arg("name")="" )) ) - .def( "get_name_ptr" - , &animal::get_name_ptr + bp::class_< animal, boost::noncopyable >( "animal", bp::init< bp::optional< std::string const & > >(( bp::arg("name")="" )) ) + .def("get_name_ptr" + , &::animal::get_name_ptr , bp::return_internal_reference< 1, bp::default_call_policies >() ) - .def( "name" - , &animal::name + .def("name" + , &::animal::name , bp::return_value_policy< bp::copy_const_reference, bp::default_call_policies >() ); bp::implicitly_convertible< std::string const &, animal >(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:09:05
|
Revision: 206 Author: roman_yakovenko Date: 2006-06-04 11:49:56 -0700 (Sun, 04 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=206&view=rev Log Message: ----------- updating docs Modified Paths: -------------- pyplusplus_dev/docs/peps/call_wrapper_policies.rest pyplusplus_dev/docs/peps/indexing_suite.rest pyplusplus_dev/docs/peps/peps_index.rest Modified: pyplusplus_dev/docs/peps/call_wrapper_policies.rest =================================================================== --- pyplusplus_dev/docs/peps/call_wrapper_policies.rest 2006-06-04 07:28:54 UTC (rev 205) +++ pyplusplus_dev/docs/peps/call_wrapper_policies.rest 2006-06-04 18:49:56 UTC (rev 206) @@ -227,7 +227,17 @@ So, how `pyplusplus`_ can help? `pyplusplus`_ can generate exception safe code, that will acquire and release Python global interpreter lock. +------- +Summary +------- +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. + +If you can help or have some nice idea, please share: +https://lists.sourceforge.net/lists/listinfo/pygccxml-development + + .. _`pyplusplus` : ./../pyplusplus.html .. |cwp| replace:: *"call wrapper policies"* .. _`boost.python`: http://www.boost.org/libs/python/doc/index.html Modified: pyplusplus_dev/docs/peps/indexing_suite.rest =================================================================== --- pyplusplus_dev/docs/peps/indexing_suite.rest 2006-06-04 07:28:54 UTC (rev 205) +++ pyplusplus_dev/docs/peps/indexing_suite.rest 2006-06-04 18:49:56 UTC (rev 206) @@ -38,7 +38,8 @@ std::vector<string> get_options(){...} -:: +:: + struct my_data{...}; std::map< int, my_data > get_data(); @@ -54,13 +55,13 @@ functionality provided by `boost.python`_ library or `pyplusplus`_ ``code repository``. -4. It will generate a code, that will use that functionality. +4. It will generate the code, that 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 `pyplusplus`_ 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 to change the defaults on that class. +class and change the defaults: :: mb = module_builder_t( ... ) @@ -80,9 +81,9 @@ Every class, that represents instantiation of some std container will have class variable ``indexing_suite``, that will be intitialized with relevant indexing suite class. + - .. _`pyplusplus` : ./../pyplusplus.html .. _`boost.python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org Modified: pyplusplus_dev/docs/peps/peps_index.rest =================================================================== --- pyplusplus_dev/docs/peps/peps_index.rest 2006-06-04 07:28:54 UTC (rev 205) +++ pyplusplus_dev/docs/peps/peps_index.rest 2006-06-04 18:49:56 UTC (rev 206) @@ -10,10 +10,9 @@ This page is an official `pyplusplus`_ "TODO" page. -For small tasks( == user requests ), the description of the task will be written -here. Big tasks will have their own 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 --------------- @@ -54,6 +53,7 @@ `pyplusplus`_ will expose C++ std containers. This `document`__ will describe how it will work. +.. __ : ./indexing_suite.html .. _`pyplusplus` : ./../pyplusplus.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-06-07 20:07:32
|
Revision: 205 Author: roman_yakovenko Date: 2006-06-04 00:28:54 -0700 (Sun, 04 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=205&view=rev Log Message: ----------- Modified Paths: -------------- pyplusplus_dev/docs/peps/www_configuration.py Added Paths: ----------- pyplusplus_dev/docs/peps/peps_index.rest Added: pyplusplus_dev/docs/peps/peps_index.rest =================================================================== --- pyplusplus_dev/docs/peps/peps_index.rest (rev 0) +++ pyplusplus_dev/docs/peps/peps_index.rest 2006-06-04 07:28:54 UTC (rev 205) @@ -0,0 +1,69 @@ +==== +TODO +==== + +.. contents:: Table of contents + +----------- +Description +----------- + +This page is an official `pyplusplus`_ "TODO" page. + +For small tasks( == user requests ), the description of the task will be written +here. Big tasks will have their own page. + + +--------------- +Unnamed classes +--------------- +There is no techical reason why unnamed classes/structs/unions are not exported +by `pyplusplus`_: +:: + + 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 `pyplusplus`_ will help users to create wrappers around those functions. + +.. __ : ./call_wrapper_policies.html + +-------------- +Indexing suite +-------------- + +`pyplusplus`_ will expose C++ std containers. This `document`__ will describe +how it will work. + + +.. _`pyplusplus` : ./../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/www_configuration.py =================================================================== --- pyplusplus_dev/docs/peps/www_configuration.py 2006-06-04 05:45:19 UTC (rev 204) +++ pyplusplus_dev/docs/peps/www_configuration.py 2006-06-04 07:28:54 UTC (rev 205) @@ -1,2 +1,4 @@ -name = 'call wrapper policies' -main_html_file = 'introduction.html' \ No newline at end of file +name = 'PEP index' +main_html_file = 'peps_index.html' +names = { 'indexing_suite' : 'indexing suite' + , 'call_wrapper_policies' : 'call wrapper policies' } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-07 20:07:27
|
Revision: 202 Author: roman_yakovenko Date: 2006-06-03 22:40:31 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=202&view=rev Log Message: ----------- switching to Python terminology Added Paths: ----------- pyplusplus_dev/docs/peps/ Removed Paths: ------------- pyplusplus_dev/docs/call_wrapper_policies/ Copied: pyplusplus_dev/docs/peps (from rev 200, pyplusplus_dev/docs/call_wrapper_policies) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-06 03:18:37
|
Revision: 201 Author: roman_yakovenko Date: 2006-06-03 20:46:19 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=201&view=rev Log Message: ----------- Modified Paths: -------------- pyplusplus_dev/unittests/vector3_tester.py Modified: pyplusplus_dev/unittests/vector3_tester.py =================================================================== --- pyplusplus_dev/unittests/vector3_tester.py 2006-06-03 19:25:19 UTC (rev 200) +++ pyplusplus_dev/unittests/vector3_tester.py 2006-06-04 03:46:19 UTC (rev 201) @@ -19,8 +19,9 @@ , *args ) def customize( self, mb ): - vec3 = mb.class_( 'Vector3' ) - mb.calldefs().use_keywords = False + vec3 = mb.class_( 'Vector3' ) + vec3.always_expose_using_scope = True + #mb.calldefs().use_keywords = False vec3.add_code( 'add_property( "val", &vector3::Vector3::val)' ) vec3.add_code( 'add_property( "x", &vector3::Vector3::x)' ) vec3.add_code( 'add_property( "y", &vector3::Vector3::y)' ) @@ -28,7 +29,8 @@ def run_tests( self, module): - v3 = module.Vector3() + v3 = module.Vector3() + self.failUnless( v3.ZERO == v3.do_smth() ) def create_suite(): suite = unittest.TestSuite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-03 19:25:38
|
Revision: 200 Author: roman_yakovenko Date: 2006-06-03 12:25:19 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=200&view=rev Log Message: ----------- adding date_time example Added Paths: ----------- pyplusplus_dev/examples/pyboost_dev/date_time_example.py Added: pyplusplus_dev/examples/pyboost_dev/date_time_example.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/date_time_example.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/date_time_example.py 2006-06-03 19:25:19 UTC (rev 200) @@ -0,0 +1,71 @@ +import os +from pyboost import date_time +from pyboost.date_time import gregorian +from pyboost.date_time import posix_time +from pyboost.date_time import local_time +from pyboost.date_time import to_simple_string + +#Date programming +weekstart = gregorian.date(2002, date_time.Feb,1) +print 'weekstart: ', to_simple_string( weekstart ) + +weekend = weekstart + gregorian.weeks(1) +print 'weekend: ', to_simple_string( weekend ) + +today = gregorian.day_clock.local_day() +d2 = weekstart + gregorian.days(5) +if d2 >= today: #comparison operator + pass + +thisWeek = gregorian.date_period(today,d2) +if thisWeek.contains(today): + pass + +#date generator functions +d5 = gregorian.next_weekday(today, date_time.Sunday); #calculate Sunday following d4 +print 'd5: ', to_simple_string( d5 ) + +#US labor day is first Monday in Sept +first = gregorian.nth_day_of_the_week_in_month.first +labor_day = gregorian.nth_day_of_the_week_in_month(first, date_time.Monday, date_time.Sep) +#calculate a specific date for 2004 from functor +print 'labor day 2004: ', to_simple_string( labor_day.get_date(2004) ) + +#Time programming: +d = gregorian.date(2002,date_time.Feb,1)#an arbitrary date +t1 = posix_time.ptime(d, posix_time.hours(5) + posix_time.millisec(100)); #date + time of day offset +print 't1: ', to_simple_string( t1 ) + +t2 = t1 - posix_time.minutes(4) + posix_time.seconds(2) +print 't2: ', to_simple_string( t2 ) + +now = posix_time.second_clock.local_time(); #use the clock +print 'now: ', to_simple_string( now ) +today = now.date() #Get the date part out of the time +print 'today: ', to_simple_string( today ) +tomorrow = today + gregorian.date_duration(1) +print 'tomorrow: ', to_simple_string( tomorrow ) + +#Local time programming: +#setup some timezones for creating and adjusting times +#first time zone uses the time zone file for regional timezone definitions +tz_db = local_time.time_zone_database() +tz_db.load_from_file( os.path.join( date_time.__path__[0], "date_time_zonespec.csv") ) +nyc_tz = tz_db.time_zone_from_region("America/New_York") +#This timezone uses a posix time zone string definition to create a time zone +phx_tz = local_time.posix_time_zone("MST-07:00:00") + +#local departure time in phoenix is 11 pm on April 2 2005 +#Note that New York changes to daylight savings on Apr 3 at 2 am) +phx_departure = local_time.local_date_time( + gregorian.date(2005, date_time.Apr, 2) + , posix_time.hours(23) + , phx_tz + , local_time.local_date_time.NOT_DATE_TIME_ON_ERROR) + +flight_length = posix_time.hours(4) + posix_time.minutes(30) +phx_arrival = phx_departure + flight_length +#//convert the phx time to a nyz time +nyc_arrival = phx_arrival.local_time_in(nyc_tz, posix_time.time_duration() ) +print "New York arrival: ", nyc_arrival.to_string() #//2005-Apr-03 06:30:00 EDT + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-03 18:24:04
|
Revision: 199 Author: roman_yakovenko Date: 2006-06-03 11:23:49 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=199&view=rev Log Message: ----------- adding apidocs directory, thus I will not have to modify setup script Added Paths: ----------- pyplusplus_dev/docs/apidocs/ pyplusplus_dev/docs/apidocs/www_configuration.py Added: pyplusplus_dev/docs/apidocs/www_configuration.py =================================================================== --- pyplusplus_dev/docs/apidocs/www_configuration.py (rev 0) +++ pyplusplus_dev/docs/apidocs/www_configuration.py 2006-06-03 18:23:49 UTC (rev 199) @@ -0,0 +1,2 @@ +name = 'API docs' +main_html_file = 'index.html' \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-03 18:15:52
|
Revision: 198 Author: roman_yakovenko Date: 2006-06-03 11:15:45 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=198&view=rev Log Message: ----------- adding apidocs directory, thus I will not have to modify setup script Added Paths: ----------- pygccxml_dev/docs/apidocs/www_configuration.py Added: pygccxml_dev/docs/apidocs/www_configuration.py =================================================================== --- pygccxml_dev/docs/apidocs/www_configuration.py (rev 0) +++ pygccxml_dev/docs/apidocs/www_configuration.py 2006-06-03 18:15:45 UTC (rev 198) @@ -0,0 +1,2 @@ +name = 'API docs' +main_html_file = 'index.html' \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-03 18:14:47
|
Revision: 197 Author: roman_yakovenko Date: 2006-06-03 11:14:38 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=197&view=rev Log Message: ----------- adding apidocs directory, thus I will not have to modify setup script Added Paths: ----------- pygccxml_dev/docs/apidocs/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-02 20:34:01
|
Revision: 196 Author: roman_yakovenko Date: 2006-06-02 13:33:54 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=196&view=rev Log Message: ----------- fixing noncopyable bug Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/type_traits.py Modified: pygccxml_dev/pygccxml/declarations/type_traits.py =================================================================== --- pygccxml_dev/pygccxml/declarations/type_traits.py 2006-06-02 18:18:33 UTC (rev 195) +++ pygccxml_dev/pygccxml/declarations/type_traits.py 2006-06-02 20:33:54 UTC (rev 196) @@ -675,26 +675,7 @@ """returns True if source could be converted to target, otherwise False""" return __is_convertible_t( source, target ).is_convertible() -def is_noncopyable( class_ ): - if class_.class_type == class_declaration.CLASS_TYPES.UNION: - return False - for base_desc in class_.recursive_bases: - assert isinstance( base_desc, class_declaration.hierarchy_info_t ) - if base_desc.related_class.decl_string in ('::boost::noncopyable', '::boost::noncopyable_::noncopyable' ): - return True - if not has_trivial_copy( base_desc.related_class ): - protected_ctrs = filter( lambda x: isinstance( x, calldef.constructor_t ) \ - and x.is_copy_constructor - , base_desc.related_class.protected_members ) - if not protected_ctrs: - return True - - if not has_trivial_copy( class_ ) \ - or not has_public_constructor( class_ )\ - or class_.is_abstract \ - or ( has_destructor( class_ ) and not has_public_destructor( class_ ) ): - return True - +def __is_noncopyable_single( class_ ): #It is not enough to check base classes, we should also to check #member variables. mvars = filter( lambda x: isinstance( x, variable.variable_t ) @@ -715,6 +696,31 @@ if is_noncopyable( cls ): return True return False + +def is_noncopyable( class_ ): + if class_.class_type == class_declaration.CLASS_TYPES.UNION: + return False + for base_desc in class_.recursive_bases: + assert isinstance( base_desc, class_declaration.hierarchy_info_t ) + if base_desc.related_class.decl_string in ('::boost::noncopyable', '::boost::noncopyable_::noncopyable' ): + return True + if not has_trivial_copy( base_desc.related_class ): + protected_ctrs = filter( lambda x: isinstance( x, calldef.constructor_t ) \ + and x.is_copy_constructor + , base_desc.related_class.protected_members ) + if not protected_ctrs: + return True + + if __is_noncopyable_single( base_desc.related_class ): + return True + + if not has_trivial_copy( class_ ) \ + or not has_public_constructor( class_ )\ + or class_.is_abstract \ + or ( has_destructor( class_ ) and not has_public_destructor( class_ ) ): + return True + + return __is_noncopyable_single( class_ ) @@ -725,5 +731,4 @@ - \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-06-02 18:21:22
|
Revision: 195 Author: roman_yakovenko Date: 2006-06-02 11:18:33 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=195&view=rev Log Message: ----------- excluding functions, that takes array as argument updating docs Modified Paths: -------------- pyplusplus_dev/docs/call_wrapper_policies/introduction.rest pyplusplus_dev/docs/comparisons/pyste.rest pyplusplus_dev/docs/examples/boost/boost.rest pyplusplus_dev/docs/examples/easybmp/easybmp.rest pyplusplus_dev/docs/history/history.rest pyplusplus_dev/docs/tutorials/module_builder/module_builder.rest pyplusplus_dev/examples/pyboost_dev/dev/date_time/include/date_time.pypp.xml pyplusplus_dev/examples/pyboost_dev/rational_example.py pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py pyplusplus_dev/unittests/algorithms_tester.py Modified: pyplusplus_dev/docs/call_wrapper_policies/introduction.rest =================================================================== --- pyplusplus_dev/docs/call_wrapper_policies/introduction.rest 2006-06-02 18:17:50 UTC (rev 194) +++ pyplusplus_dev/docs/call_wrapper_policies/introduction.rest 2006-06-02 18:18:33 UTC (rev 195) @@ -26,6 +26,8 @@ `pyplusplus`_ to generate right wrapper. Also, it will be possible to create a custom policies. +This document describes what is *going to be implemented*. + -------- Analysis -------- @@ -50,9 +52,9 @@ Variable names -------------- -I think it should be possible to apply few |cwp| on a single function. -The main, ( read unresolved ) issue, is management of variable names within -function-wrapper. I see next problems, that we should solve, before proceeding +I think it should be possible to apply few |cwp| on a single function. +The main, ( read unresolved ) issue, is management of variable names within +function-wrapper. I see next problems, that we should solve, before proceeding to implementation: 1. To share variable name, between different pieces of code. @@ -198,7 +200,7 @@ - size of array is some global/local variable - - ize of array is returned by invocation some function + - size of array is returned by invocation some function status as exception Modified: pyplusplus_dev/docs/comparisons/pyste.rest =================================================================== --- pyplusplus_dev/docs/comparisons/pyste.rest 2006-06-02 18:17:50 UTC (rev 194) +++ pyplusplus_dev/docs/comparisons/pyste.rest 2006-06-02 18:18:33 UTC (rev 195) @@ -8,54 +8,54 @@ What is `pyplusplus`_? ---------------------- -.. include:: ../definition.rest +.. include:: ../definition.rest ----------------- What is `Pyste`_? ----------------- -`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 -`GCC-XML`_ to parse all the headers and extract the necessary information to +`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 +`GCC-XML`_ to parse all the headers and extract the necessary information to automatically generate C++ code. -------- Preamble -------- -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`_. +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: * user interface - + * design - + * dependencies - + * features list: - + * supported `boost.python`_ components - + * nice features -I did not develop `Pyste`_, so it is possible I made few mistakes in my -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 +I did not develop `Pyste`_, so it is possible I made few mistakes in my +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 problems with `Pyste`_: - 1. It is time consuming operation to maintain `Pyste`_ scripts in a big, + 1. It is time consuming operation to maintain `Pyste`_ scripts in a big, dynamic project. - + 2. It is very difficult to customize generated code. I will provide few examples later. 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`_. +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`_. Later you will find few points, that explains, why I decided not to fix `Pyste`_. Have a nice reading. @@ -67,33 +67,33 @@ Pyste ----- -Carefully read `Pyste`_ definition - +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 + "... 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. ..." - -Simple interface file is an advantage and a disadvantage at the same time. The -advantage is obvious: it is easy to start to use. The disadvantage is less + +Simple interface file is an advantage and a disadvantage at the same time. The +advantage is obvious: it is easy to start to use. The disadvantage is less obvious - you can not work on whole exported library at once. - 1. Try to exclude all functions, that nth argument has some specific type. - + 1. Try to exclude all functions, that nth argument has some specific type. + 2. Try to exclude\\leave all classes, that belongs to some namespace. - + 3. Maintenance. Every time you add new file\\class to your project you should modify\\create `Pyste`_ interface files. 4. Try to set call policies to functions based on some detail\\fact. - -First and second example could be solved, but it is neither easy, nor obvious. -You should understand `Pyste`_ implementation details. Third example is solvable -if you are lucky and ready to write few `Python`_\\shell scripts. - "... AllFromHeader is broken in some cases. Until it is fixed, use at you own - risk. ..." +First and second example could be solved, but it is neither easy, nor obvious. +You should understand `Pyste`_ implementation details. Third example is solvable +if you are lucky and ready to write few `Python`_\\shell scripts. + "... AllFromHeader is broken in some cases. Until it is fixed, use at you own + risk. ..." + ---`Pyste`_ documentation. I have more examples, but I think you've got the idea. @@ -101,30 +101,30 @@ pyplusplus ---------- -`pyplusplus`_ has 2 user interfaces: +`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 its `screenshot`_. - + 2. API - object-oriented framework, that helps you to create code generator, that suites your needs. `pyplusplus`_ 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 - going to be written. Neither they care about the order of generated - code. - + package is to create code. Those classes do not care where code is + going to be written. Neither they care about the order of generated + code. + 2. Module creator package. This is code creators factory. Classes in this package analyze C++ declarations and creates relevant code creators. - + 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 `pyplusplus`_, 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. - +task. It is not as awful as it sounds, but still there is some learning curve. + ------ Design ------ @@ -133,151 +133,151 @@ ----- `Pyste`_ design is not bad at all, but there were few mistakes made. First of all -current situation. There is a class hierarchy that represents C++ declarations -and types. There is *Exporter*'s hierarchy. There are 2 unrelated classes -*SingleCodeUnit* and *MultipleCodeUnit*. +current situation. There is a class hierarchy that represents C++ declarations +and types. There is *Exporter*'s hierarchy. There are 2 unrelated classes +*SingleCodeUnit* and *MultipleCodeUnit*. Class *Exporter* has few responsibilities: 1. to create code - + 2. to write code into code unit 3. to decide what, how and in which order declarations should be exported (excluded) - + Classes *SingleCodeUnit* and *MultipleCodeUnit* also has few responsibilities: 1. to write code into files - + 2. to control the order of written code - + pyplusplus ---------- -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`_, -I created `pygccxml`_. `pygccxml`_ is a stand alone project, that provides few -things: - +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`_, +I created `pygccxml`_. `pygccxml`_ is a stand alone project, that provides few +things: + * hierarchy of C++ declarations - + * hierarchy of C++ types - + * few parsing strategies: - + + all files will be parsed as it was one file that include all them - - + every file will be parsed alone, after this, duplicated declarations + + + every file will be parsed alone, after this, duplicated declarations and types will be removed `pygccxml`_ contributes in few ways to `pyplusplus`_: + `pyplusplus`_ has nothing to do with code parsing. Theoretically - an other back-end could be added to `pygccxml`_ without changing even one + an other back-end could be added to `pygccxml`_ without changing even one line of code within `pyplusplus`_. - + `pygccxml`_ has type traits. A lot of type traits algorithms from + + `pygccxml`_ has type traits. A lot of type traits algorithms from `boost.type_traits`_ library has been implemented. `pyplusplus`_ makes an extensive use of them: - + * identify "call policies" algorithm - + * code creator that generates body of "overridden" virtual functions: - :: + :: struct expensive_to_copy{...}; - - void do_smth( expensive_to_copy* x, const expensive_to_copy& y ){...} - + + void do_smth( expensive_to_copy* x, const expensive_to_copy& y ){...} + void 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 - *this->get_override("do_smth")( boost::python::ptr(x), boost::ref(y) ); + *this->get_override("do_smth")( boost::python::ptr(x), boost::ref(y) ); //------------------------------^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^ } - - Do you see the difference? This is a prove to the point I made earlier: + + Do you see the difference? This is a prove to the point I made earlier: `Pyste`_ generates not optimal code. - - + Do you remember first 3 problems, I talked about? - 1. Try to exclude all functions, that nth argument has some specific type. - + + Do you remember first 3 problems, I talked about? + + 1. Try to exclude all functions, that nth argument has some specific type. + 2. Try to exclude\\leave all classes, that belongs to some namespace. - + 3. Maintenance. Every time you add new file\\class to your project you should modify\\create `Pyste`_ interface files. - They are solved by `pygccxml`_ package. Please take a look on `pygccxml`_ - `query intrface`__ documentation. - + They are solved by `pygccxml`_ package. Please take a look on `pygccxml`_ + `query interface`__ documentation. + .. __ : ./../../pygccxml/query_interface.html - + Now about mistakes. There is a gold rule: one class, one responsibility. `Pyste`_ breaks this rule. One more time *Exporter* class responsibilities: 1. to create code - + 2. to write code into code unit 3. to decide what, how and in which order declarations should be exported (excluded) What is wrong with this? In some places the logic of code generation is complex. -`Pyste`_ makes this situation worse. In order to understand my point try to see, +`Pyste`_ makes this situation worse. In order to understand my point try to see, 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. +export all its base classes before it exports itself. This is just wrong. `pyplusplus`_ implements better solution. `pyplusplus`_ has code creators class -hierarchy and factory, that creates those code creators based on given +hierarchy and factory, that creates those code creators based on given declarations. The questions like: - + * what should be the order of exporting declarations - - * could\\should the declaration be exported + * could \\ should the declaration be exported + * what are the call policies of the function - + * what is the class held type - + 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 -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. +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 +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. -An other weakness is a relationship between *Exporter*'s and code units. In -order to write code into code unit, *Exporter* should specify section name and -text. There are few problems with this. First of all, this tight coupling is -unnecessary. In order to add new *Exporter* you should understand the underlying -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 -should be created only by code creators. This decision simplifies a lot of +An other weakness is a relationship between *Exporter*'s and code units. In +order to write code into code unit, *Exporter* should specify section name and +text. There are few problems with this. First of all, this tight coupling is +unnecessary. In order to add new *Exporter* you should understand the underlying +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 +should be created only by code creators. This decision simplifies a lot of things: * code creators does not depend on file writers - + * file writers do not have to know all code creators - + * code creators set is not closed and could be extended - + * user can place custom code creator almost any where - + * code creators can take into account code that is going to be generated by other code creators. For example namespace aliases or include directives. - + * ... ------------ Dependencies ------------ -Both `Pyste`_ and `pyplusplus`_ introduce one external dependency. In order to +Both `Pyste`_ and `pyplusplus`_ introduce one external dependency. In order to parse XML `Pyste`_ uses `elementtree`_. On the other side `pyplusplus`_ depends on `pygccxml`_ project. @@ -288,71 +288,71 @@ 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 `pyplusplus`_. Features unique to `pyplusplus`_: * `pyplusplus`_ exposes protected member functions - + * `pyplusplus`_, in most cases, will automatically detect class held type - + * `pyplusplus`_ creates implicit conversion code for: - + + casting constructors - + + casting operators - + + smart pointers of derived and base class - + * class wrappers generated using `boost.python`_ wrapper class - - * operator() always exposed ( this is not the case with `Pyste`_ ) - + + * operator() always exposed ( this is not the case with `Pyste`_ ) + * operators defined in base class could be redefined/exposed in derived class - + * `pyplusplus`_ 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 +cases `pyplusplus`_ do better job. `pyplusplus`_ allows next customization on generated code: - * To define std and user directories. *include_t* code creator will take + * To define std and user directories. *include_t* code creator will take those directories into account. - - * To define namespace alias. - :: - namespace dt = boost::date_time; + * To define namespace alias. + :: - All code, that is generated after this statement, will use ``dt`` instead of + 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. - + * Classes and functions support 2 modes of code generation. Example: - :: + :: struct world{ void set(std::string msg) { this->msg = msg; } std::string greet() { return msg; } std::string msg; }; - + First mode: - :: + :: class_<world>("world") .def("greet", &world::greet) .def("set", &world::set) ; - + Second mode: - :: + :: if( true ){ typedef class_<world> world_exposer_t; @@ -361,25 +361,25 @@ world_exposer.def( "greet", ( std::string ( world::* )() )( &world::greet ) ); world_exposer.def( "set", ( void ( world::* )(std::string) )( &world::set ) ); } - + Second mode is better then first, because: - + 1. It is easier to understand compilation error. - + 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 + + * `pyplusplus`_ 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 + * `pyplusplus`_ allows user to define custom call policies resolver. See boost.date_time example - * `pyplusplus`_ allows user to create custom code creators. See + * `pyplusplus`_ allows user to create custom code creators. See "custom_code_creator" example. - * real world examples: - + * real world examples: + + EasyBMP + boost.date_time @@ -392,27 +392,27 @@ 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`_. +For big projects, you need flexibility and power of `pyplusplus`_. ---- P.S. ---- -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 +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`_. `Pyste`_ - `Pyste`_ is `boost.python`_ code generator. - - `pyplusplus`_ - .. include:: ../definition.rest + `Pyste`_ is `boost.python`_ code generator. + `pyplusplus`_ + .. include:: ../definition.rest + `Pyste`_ and `pyplusplus`_ 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 +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 of time and motivation prevents him to work on `Pyste`_. .. _`screenshot` : ./../tutorials/pyplusplus_demo.png Modified: pyplusplus_dev/docs/examples/boost/boost.rest =================================================================== --- pyplusplus_dev/docs/examples/boost/boost.rest 2006-06-02 18:17:50 UTC (rev 194) +++ pyplusplus_dev/docs/examples/boost/boost.rest 2006-06-02 18:18:33 UTC (rev 195) @@ -7,66 +7,66 @@ -------------- Introduction -------------- - -What is the `pyplusplus`_? --------------------------- - -.. include:: ./../../definition.rest - + +What is the `pyplusplus`_? +-------------------------- + +.. include:: ./../../definition.rest + What is the Boost? ------------------ -`Boost`_ is repository of free peer-reviewed portable C++ source libraries. - -`Boost`_ works on almost any modern operating system, including UNIX and Windows -variants. +`Boost`_ is repository of free peer-reviewed portable C++ source libraries. +`Boost`_ works on almost any modern operating system, including UNIX and Windows +variants. + Abstract -------- -`Boost`_ libraries have good interface, documentation and unit tests. -A lot of people contributed thier knowledge and expirience to those libraries. -Ten `Boost`_ libraries are already included in the `C++ Standards Committee's`_ -Library Technical Report ( `TR1`_ ) as a step toward becoming part of a future -C++ Standard. More Boost libraries are proposed for the upcoming `TR2`_. - -.. _`C++ Standards Committee's` : http://www.open-std.org/jtc1/sc22/wg21/ -.. _`TR1` : http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1745.pdf -.. _`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: - - * `boost.date_time`_ - * `boost.crc`_ - * `boost.rational`_ - * `boost.random`_ - -There are few reasons I choose to expose those libraries. - -1. I used those libraries at my work. - -2. All those libraries have: +`Boost`_ libraries have good interface, documentation and unit tests. +A lot of people contributed their knowledge and experience to those libraries. +Ten `Boost`_ libraries are already included in the `C++ Standards Committee's`_ +Library Technical Report ( `TR1`_ ) as a step toward becoming part of a future +C++ Standard. More Boost libraries are proposed for the upcoming `TR2`_. +.. _`C++ Standards Committee's` : http://www.open-std.org/jtc1/sc22/wg21/ +.. _`TR1` : http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1745.pdf +.. _`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: + + * `boost.date_time`_ + * `boost.crc`_ + * `boost.rational`_ + * `boost.random`_ + +There are few reasons I choose to expose those libraries. + +1. I used those libraries at my work. + +2. All those libraries have: + * good documentation * well defined interfaces - * clear concepts - * comprehensive unit tests - -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`_, -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. - ---------------- -pyboost package ---------------- + * clear concepts + * comprehensive unit tests +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`_, +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. + +--------------- +pyboost package +--------------- + Documentation ------------- Right now, pyboost package does not have a documentation. In my opinion it is @@ -76,48 +76,168 @@ Examples -------- +One picture worth thousends words. + random ~~~~~~ * C++ code: http://boost.org/libs/random/index.html - + * Python code: :: import time from pyboost import boost_random - | + + :: + rng = boost_random.mt19937( int( time.time() ) ) #setting initial seed six = boost_random.uniform_int(1,6) die = boost_random.variate_generator( rng, six ) - | + + :: + print die() +date_time +~~~~~~~~~ + +* C++ code: http://www.boost.org/doc/html/date_time/examples/general_usage_examples.html + +* Python code: + + :: + + import os + from pyboost import date_time + from pyboost.date_time import gregorian + from pyboost.date_time import posix_time + from pyboost.date_time import local_time + from pyboost.date_time import to_simple_string + + :: + + # + #Date programming + # + weekstart = gregorian.date(2002, date_time.Feb,1) + print 'weekstart: ', to_simple_string( weekstart ) + + :: + + weekend = weekstart + gregorian.weeks(1) + print 'weekend: ', to_simple_string( weekend ) + + :: + + today = gregorian.day_clock.local_day() + d2 = weekstart + gregorian.days(5) + if d2 >= today: #comparison operator + pass + + :: + + thisWeek = gregorian.date_period(today,d2) + if thisWeek.contains(today): + pass + + :: + + #date generator functions + d5 = gregorian.next_weekday(today, date_time.Sunday); #calculate Sunday following d4 + print 'd5: ', to_simple_string( d5 ) + + :: + + #US labor day is first Monday in Sept + first = gregorian.nth_day_of_the_week_in_month.first + labor_day = gregorian.nth_day_of_the_week_in_month(first, date_time.Monday, date_time.Sep) + #calculate a specific date for 2004 from functor + print 'labor day 2004: ', to_simple_string( labor_day.get_date(2004) ) + + :: + + # + #Time programming: + # + d = gregorian.date(2002,date_time.Feb,1)#an arbitrary date + t1 = posix_time.ptime(d, posix_time.hours(5) + posix_time.millisec(100)); #date + time of day offset + print 't1: ', to_simple_string( t1 ) + + :: + + t2 = t1 - posix_time.minutes(4) + posix_time.seconds(2) + print 't2: ', to_simple_string( t2 ) + + :: + + now = posix_time.second_clock.local_time(); #use the clock + print 'now: ', to_simple_string( now ) + today = now.date() #Get the date part out of the time + print 'today: ', to_simple_string( today ) + tomorrow = today + gregorian.date_duration(1) + print 'tomorrow: ', to_simple_string( tomorrow ) + + :: + + # + #Local time programming: + # + #setup some timezones for creating and adjusting times + #first time zone uses the time zone file for regional timezone definitions + tz_db = local_time.time_zone_database() + tz_db.load_from_file( os.path.join( date_time.__path__[0], "date_time_zonespec.csv") ) + nyc_tz = tz_db.time_zone_from_region("America/New_York") + #This timezone uses a posix time zone string definition to create a time zone + phx_tz = local_time.posix_time_zone("MST-07:00:00") + + :: + + #local departure time in phoenix is 11 pm on April 2 2005 + #Note that New York changes to daylight savings on Apr 3 at 2 am) + phx_departure = local_time.local_date_time( + gregorian.date(2005, date_time.Apr, 2) + , posix_time.hours(23) + , phx_tz + , local_time.local_date_time.NOT_DATE_TIME_ON_ERROR) + + :: + + flight_length = posix_time.hours(4) + posix_time.minutes(30) + phx_arrival = phx_departure + flight_length + #convert the phx time to a nyz time + nyc_arrival = phx_arrival.local_time_in(nyc_tz, posix_time.time_duration() ) + print "New York arrival: ", nyc_arrival.to_string() #//2005-Apr-03 06:30:00 EDT + + rational ~~~~~~~~ * C++ code: http://boost.org/libs/rational/rational_example.cpp * Python code: - + :: import unittest from pyboost import rational - - + + :: + half = rational.rational( 1, 2 ) one = rational.rational( 1 ) two = rational.rational( 2 ) - - + + :: + #Some basic checks assert half.numerator() == 1 assert half.denominator() == 2 assert float(half) == 0.5 - - + + :: + #Arithmetic assert half + half == one == 1 assert one - half == half @@ -137,14 +257,15 @@ import os import sys from pyboost import crc - - + + :: + if __name__ == '__main__': if sys.argv: files = sys.argv else: files = [ sys.executable ] - + try: result = crc.crc_32_type() for file_name in files: @@ -160,22 +281,22 @@ Download -------- -http://sourceforge.net/project/showfiles.php?group_id=118209. - - -.. _`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 - +http://sourceforge.net/project/showfiles.php?group_id=118209. + +.. _`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 + + .. _`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 .. _`Python`: http://www.python.org .. _`pygccxml`: http://www.language-binding.net/pygccxml/pygccxml.html .. _`boost.date_time`: http://boost.org/doc/html/date_time.html .. _`date_time`: http://boost.org/doc/html/date_time.html -.. _`boost`: http://www.boost.org +.. _`boost`: http://www.boost.org .. _`Boost`: http://www.boost.org .. _`boost.python`: http://www.boost.org/libs/python/doc/index.html .. _`boost.operators`: http://www.boost.org/ Modified: pyplusplus_dev/docs/examples/easybmp/easybmp.rest =================================================================== --- pyplusplus_dev/docs/examples/easybmp/easybmp.rest 2006-06-02 18:17:50 UTC (rev 194) +++ pyplusplus_dev/docs/examples/easybmp/easybmp.rest 2006-06-02 18:18:33 UTC (rev 195) @@ -11,35 +11,35 @@ What is EasyBMP? ------------------- -`EasyBMP`_ is a simple, cross-platform, open source (LGPL) C++ library designed -for easily reading, writing, and modifying Windows bitmap (BMP) image files. +`EasyBMP`_ is a simple, cross-platform, open source (LGPL) C++ library designed +for easily reading, writing, and modifying Windows bitmap (BMP) image files. In this example I am referring to version 0.70. What is `pyplusplus`_? ---------------------- -.. include:: ./../../definition.rest +.. include:: ./../../definition.rest ----------- Description ----------- -`pyplusplus`_ 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 -minutes to create full working python version of this library. This examples +`pyplusplus`_ 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 +minutes to create full working python version of this library. This examples consist few files and directories: 1. environment.py - contains different environment settings - 2. generate_code.py - contains source code needed to generate + 2. generate_code.py - contains source code needed to generate `boost.python`_ bindings for `EasyBMP`_ library. - + 3. sconstruct - build configuration file 4. generated - directory that contains all generated code and only it - + 5. unittests - directory that contains gray scale example from tutorials. C++ @@ -66,7 +66,7 @@ -------- http://sourceforge.net/project/showfiles.php?group_id=118209. - + .. _`pyplusplus` : ./../../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 Modified: pyplusplus_dev/docs/history/history.rest =================================================================== --- pyplusplus_dev/docs/history/history.rest 2006-06-02 18:17:50 UTC (rev 194) +++ pyplusplus_dev/docs/history/history.rest 2006-06-02 18:18:33 UTC (rev 195) @@ -3,74 +3,87 @@ ============================== .. contents:: Table of contents - -------------- -Version 0.8.0 -------------- - -1. `pyplusplus`_ "user guide" functionality has been improved. Now `pyplusplus`_ - 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. - -3. Small redesign has been done - now it is much easier to understand and - maintain code creators, that creates code for C++ functions. - -4. Exception specification is taken into account, when `pyplusplus`_ exports - member functions. - -5. Member variables, that are pointers exported correctly. - + + +------------ +Contributors +------------ + +Thanks to all the people that have contributed patches, bug reports and suggestions: + + * My wife - Yulia + * John Pallister + * Matthias Baas + * Allen Bierbaum + * Lakin Wecker + +------------- +Version 0.8.0 +------------- + +1. `pyplusplus`_ "user guide" functionality has been improved. Now `pyplusplus`_ + 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. + +3. Small redesign has been done - now it is much easier to understand and + maintain code creators, that creates code for C++ functions. + +4. Exception specification is taken into account, when `pyplusplus`_ exports + member functions. + +5. Member variables, that are pointers exported correctly. + 6. Adding experimental support for ``vector_indexing_suite``. -7. Bug fixes. - +7. Bug fixes. + ------------- Version 0.7.0 ------------- - -Many thanks to *Matthias Baas* and *Allen Bierbaum*! They contributed so much to -pyplusplus, especially Matthias: - - * New high level API: `pyplusplus`_ has simple and poweful API - - * Documentation: Matthias and Allen added a lot of documentation strings - - * Bug fixes and performance improvments +Many thanks to *Matthias Baas* and *Allen Bierbaum*! They contributed so much to +pyplusplus, especially Matthias: + + * New high level API: `pyplusplus`_ has simple and poweful API + + * Documentation: Matthias and Allen added a lot of documentation strings + + * Bug fixes and performance improvments + 1. New GUI features: - + * It is possible now to see XML generated by GCC-XML. - - * It is possible to use GUI as wizard. It will help you to start with + + * It is possible to use GUI as wizard. It will help you to start with pyplusplus, by generating pyplusplus code. 2. **Attention - non backward compatible change**. - ``module_creator.creator_t.__init__`` method has been changed. ``decls`` - argument could be interpreted as - + ``module_creator.creator_t.__init__`` method has been changed. ``decls`` + argument could be interpreted as + * list of all declaration to be exported - * list of top level declarations. ``creator_t`` should export all + * list of top level declarations. ``creator_t`` should export all declarations recursively. In order to clarify the use of ``decls`` argument new argument ``recursive`` has been added. By default new value of ``recursive`` is ``False``. - - Guide for users/upgraders: if use are exporting all declaration without - filtering, you should set ``recursive`` argument to ``True``. If you use - ``pygccxml.declarations.filtering.*`` functions, you have nothing to do. + Guide for users/upgraders: if use are exporting all declaration without + filtering, you should set ``recursive`` argument to ``True``. If you use + ``pygccxml.declarations.filtering.*`` functions, you have nothing to do. + Sorry for the inconvenience :-(. - + 3. Better split of extension module to files. From now next declarations will have dedicated file: - + * named enumerations, defined within namespace * unnamed enumerations and global variables * free functions @@ -79,63 +92,63 @@ one file, ``main.cpp``, to be very low. Also it is possible to implement solution, where ``main.cpp`` file does not contain templates instanitations at all. - + 4. Only constant casting operators could be used with ``implicitly_convertible``. This bug has been fixed. - + 5. Bug exporting non copyable class has been fixed. 6. Small bug fix - from now file with identical content will not be overwritten. - -7. Boost.Python ``optional`` is now supported and used when a constructor has a - a default argument. - -8. `pyplusplus`_ now generates correct code for hierarchy of abstract classes: - :: - - struct abstract1{ - virtual void do_smth() = 0; - } - - struct abstract2 : public abstract1{ - virtual void do_smth_else() = 0; - } - - struct concrete : public abstract2{ - virtual void do_smth(){}; - virtual void do_smth_else(){}; - } - -9. Logging functionality has been added - -10. New packages ``module_builder``, ``decl_wrappers`` and ``_logging_`` has - been added. - -11. ... - -http://boost.org/libs/python/doc/v2/init.html#optional-spec +7. Boost.Python ``optional`` is now supported and used when a constructor has a + a default argument. + +8. `pyplusplus`_ now generates correct code for hierarchy of abstract classes: + :: + + struct abstract1{ + virtual void do_smth() = 0; + } + + struct abstract2 : public abstract1{ + virtual void do_smth_else() = 0; + } + + struct concrete : public abstract2{ + virtual void do_smth(){}; + virtual void do_smth_else(){}; + } + +9. Logging functionality has been added + +10. New packages ``module_builder``, ``decl_wrappers`` and ``_logging_`` has + been added. + +11. ... + +http://boost.org/libs/python/doc/v2/init.html#optional-spec + ------------- Version 0.6.0 ------------- 1. Code repository has been introduced. This repository contains classes - and functions that will help users to export different C++ classes and + and functions that will help users to export different C++ classes and declarations. Right now this repository contains two classes: - + * *array_1_t* - + * *const_array_1_t* - Those classes helps to export static, single dimension arrays. - -2. Code generation has been improved. + Those classes helps to export static, single dimension arrays. -3. Code generation speed has been improved. +2. Code generation has been improved. -4. If you have Niall Douglas *void\** patch, then you can enjoy from +3. Code generation speed has been improved. + +4. If you have Niall Douglas *void\** patch, then you can enjoy from automatically set call policies. - + 5. Bit fields can be accessed from Python 6. Creating custom code creater example has been added. Modified: pyplusplus_dev/docs/tutorials/module_builder/module_builder.rest =================================================================== --- pyplusplus_dev/docs/tutorials/module_builder/module_builder.rest 2006-06-02 18:17:50 UTC (rev 194) +++ pyplusplus_dev/docs/tutorials/module_builder/module_builder.rest 2006-06-02 18:18:33 UTC (rev 195) @@ -40,7 +40,7 @@ module_builder_t.__init__ ------------------------- -First of all, what is needed in order to creates an instance of the class? +First of all, what is needed in order to create an instance of the class? ``module_builder_t.__init__`` methods takes few arguments: Modified: pyplusplus_dev/examples/pyboost_dev/dev/date_time/include/date_time.pypp.xml =================================================================== --- pyplusplus_dev/examples/pyboost_dev/dev/date_time/include/date_time.pypp.xml 2006-06-02 18:17:50 UTC (rev 194) +++ pyplusplus_dev/examples/pyboost_dev/dev/date_time/include/date_time.pypp.xml 2006-06-02 18:18:33 UTC (rev 195) @@ -1,57 +1,57 @@ <?xml version="1.0"?> <GCC_XML cvs_revision="1.112"> - <Namespace id="_1" name="::" members="_3 _4 _5 _6 _7 _8 _9 _10 _11 _12 _13 _14 _15 _16 _17 _18 _19 _20 _21 _22 _23 _24 _25 _26 _27 _28 _29 _30 _31 _32 _33 _34 _35 _36 _37 _38 _39 _40 _41 _42 _43 _44 _45 _46 _47 _48 _49 _50 _51 _52 _53 _54 _55 _56 _57 _58 _59 _60 _61 _62 _63 _64 _65 _66 _67 _68 _69 _70 _71 _72 _73 _74 _75 _76 _77 _78 _79 _80 _81 _82 _83 _84 _85 _86 _87 _88 _89 _90 _91 _92 _93 _94 _95 _96 _97 _98 _99 _100 _101 _102 _103 _104 _105 _106 _107 _108 _109 _110 _111 _112 _113 _114 _115 _116 _117 _118 _119 _120 _121 _122 _123 _124 _125 _126 _127 _128 _129 _130 _131 _132 _133 _134 _135 _136 _137 _138 _139 _140 _141 _142 _143 _144 _145 _146 _147 _148 _149 _150 _151 _152 _153 _154 _155 _156 _157 _158 _159 _160 _161 _162 _163 _164 _165 _166 _167 _168 _169 _170 _171 _172 _173 _174 _175 _176 _177 _178 _179 _180 _181 _182 _183 _184 _185 _186 _187 _188 _189 _190 _191 _192 _193 _194 _195 _196 _197 _198 _199 _200 _201 _202 _203 _204 _205 _206 _207 _208 _209 _210 _211 _212 _213 _214 _215 _216 _217 _218 _219 _220 _221 _222 _223 _224 _225 _226 _227 _228 _229 _230 _231 _232 _233 _234 _235 _236 _237 _238 _239 _240 _241 _242 _243 _244 _245 _246 _247 _248 _249 _250 _251 _252 _253 _254 _255 _256 _257 _258 _259 _260 _261 _262 _263 _264 _265 _266 _267 _268 _269 _270 _271 _272 _273 _274 _275 _276 _277 _278 _279 _280 _281 _282 _283 _284 _285 _286 _287 _288 _289 _290 _291 _292 _293 _294 _295 _296 _297 _298 _299 _300 _301 _302 _303 _304 _305 _306 _307 _308 _309 _310 _311 _312 _313 _314 _315 _316 _317 _318 _319 _320 _321 _322 _323 _324 _325 _326 _327 _328 _329 _330 _331 _332 _333 _334 _335 _336 _337 _338 _339 _340 _341 _342 _343 _344 _345 _346 _347 _348 _349 _350 _351 _352 _353 _354 _355 _356 _357 _358 _359 _360 _361 _362 _363 _364 _365 _366 _367 _368 _369 _370 _371 _372 _373 _374 _375 _376 _377 _378 _379 _380 _381 _382 _383 _384 _385 _386 _387 _388 _389 _390 _391 _392 _393 _394 _395 _396 _397 _398 _399 _400 _401 _402 _403 _404 _405 _406 _407 _408 _409 _410 _411 _412 _413 _414 _415 _416 _417 _418 _419 _420 _421 _422 _423 _424 _425 _426 _427 _428 _429 _430 _431 _432 _433 _434 _435 _436 _437 _438 _439 _440 _441 _442 _443 _444 _445 _446 _447 _448 _449 _450 _451 _452 _453 _454 _455 _456 _457 _458 _459 _460 _461 _462 _463 _464 _465 _466 _467 _468 _469 _470 _471 _472 _473 _474 _475 _476 _477 _478 _479 _480 _482 _483 _484 _485 _486 _487 _488 _489 _490 _491 _492 _493 _494 _495 _496 _497 _498 _499 _501 _502 _503 _504 _505 _506 _508 _509 _510 _511 _512 _513 _514 _515 _516 _517 _518 _519 _520 _521 _522 _523 _524 _525 _526 _527 _528 _529 _530 _531 _532 _533 _534 _535 _536 _537 _538 _539 _540 _541 _542 _543 _544 _545 _546 _547 _548 _549 _550 _551 _552 _553 _554 _555 _556 _557 _558 _559 _560 _561 _562 _563 _564 _565 _566 _567 _568 _569 _570 _571 _572 _573 _574 _575 _576 _577 _578 _579 _580 _581 _582 _583 _584 _585 _586 _587 _588 _589 _590 _591 _592 _593 _594 _595 _596 _597 _598 _599 _600 _601 _602 _603 _604 _605 _606 _607 _608 _609 _610 _611 _612 _613 _614 _615 _616 _617 _618 _619 _621 _622 _623 _624 _625 _626 _627 _628 _629 _630 _631 _632 _633 _634 _635 _636 _638 _639 _640 _641 _642 _643 _644 _645 _646 _647 _648 _649 _650 _651 _652 _653 _654 _655 _656 _657 _658 _659 _660 _661 _662 _663 _664 _665 _666 _667 _668 _669 _670 _671 _672 _673 _674 _675 _676 _677 _678 _679 _680 _681 _682 _683 _684 _685 _686 _687 _688 _689 _690 _691 _692 _693 _694 _695 _696 _697 _698 _699 _700 _701 _702 _703 _704 _705 _706 _707 _708 _709 _710 _711 _712 _713 _714 _715 _716 _717 _718 _719 _720 _721 _722 _723 _724 _725 _726 _727 _728 _729 _730 _731 _732 _733 _734 _735 _736 _737 _738 _739 _740 _741 _742 _743 _744 _745 _746 _747 _748 _749 _750 _751 _752 _753 _754 _755 _756 _757 _758 _759 _760 _761 _762 _763 _764 _766 _767 _768 _769 _770 _771 _772 _773 _774 _775 _776 _777 _778 _779 _780 _781 _782 _783 _784 _785 _786 _787 _788 _789 _790 _791 _792 _793 _794 _795 _796 _797 _798 _799 _800 _801 _802 _803 _804 _805 _806 _807 _808 _809 _810 _811 _812 _813 _814 _815 _816 _817 _819 _820 _821 _823 _824 _825 _826 _827 _828 _829 _830 _831 _832 _833 _834 _835 _836 _837 _838 _839 _840 _841 _842 _843 _844 _845 _846 _847 _848 _849 _850 _851 _852 _853 _854 _855 _856 _857 _858 _859 _860 _861 _862 _863 _864 _865 _866 _867 _868 _869 _870 _871 _872 _873 _874 _875 _876 _877 _878 _879 _880 _881 _882 _883 _884 _885 _886 _887 _888 _889 _890 _891 _892 _893 _894 _895 _896 _897 _898 _899 _900 _901 _902 _903 _904 _905 _906 _907 _908 _909 _910 _911 _912 _913 _914 _915 _916 _917 _918 _919 _920 _921 _922 _923 _924 _925 _926 _927 _928 _929 _930 _931 _932 _933 _934 _935 _936 _937 _938 _939 _940 _941 _942 _943 _944 _945 _946 _947 _948 _949 _950 _951 _952 _953 _954 _955 _956 _957 _958 _959 _960 _961 _962 _963 _964 _965 _966 _967 _968 _969 _970 _971 _972 _973 _974 _975 _976 _977 _978 _979 _980 _981 _982 _983 _984 _985 _986 _987 _988 _989 _990 _991 _992 _993 _994 _995 _996 _997 _998 _999 _1000 _1001 _1002 _1003 _1005 _1006 _1007 _1008 _1009 _1010 _1011 _1012 _1013 _1014 _1015 _1016 _1017 _1018 _1019 _1020 _1021 _1022 _1023 _1024 _1025 _1026 _1027 _1028 _1029 _1030 _1031 _1032 _1033 _1034 _1035 _1036 _1037 _1038 _1039 _1040 _1041 _1042 _1043 _1044 _1045 _1046 _1047 _1048 _1049 _1050 _1051 _1052 _1053 _1054 _1055 _1056 _1057 _1058 _1059 _1060 _1061 _1062 _1063 _1064 _1065 _1066 _1067 _1068 _1069 _1070 _1071 _1072 _1073 _1074 _1075 _1076 _1077 _1078 _1079 _1080 _1081 _1082 _1083 _1084 _1085 _1086 _1087 _1088 _1089 _1090 _1091 _1092 _1093 _1094 _1095 _1096 _1097 _1098 _1099 _1100 _1101 _1102 _1103 _1104 _1106 _1108 _1110 _1111 _1112 _1113 _1114 _1115 _1116 _1117 _1118 _1119 _1120 _1121 _1122 _1123 _1124 _1125 _1126 _1127 _1128 _1129 _1130 _1131 _1132 _1133 _1135 _1134 _1137 _1139 _1141 _1143 _1144 _1145 _1146 _1147 _1148 _1149 _1150 _1151 _1152 _1153 _1155 _1156 _1157 _1158 _1160 _1161 _1163 _1164 _1166 _1167 _1169 _1171 _1173 _1175 _1177 _1179 _1181 _1183 _1185 _1186 _1187 _1188 _1189 _1190 _1191 _1105 _1107 _765 _1192 _1194 _1195 _1193 _1196 _1197 _1198 _1199 _1200 _1201 _1202 _1203 _1204 _1205 _1206 _1207 _1208 _1209 _1210 _1211 _1212 _1213 _1214 _1215 _1216 _1217 _1218 _1219 _1220 _1221 _1222 _1223 _1224 _1225 _1226 _1227 _1228 _1229 _1230 _1231 _1232 _1233 _1234 _1235 _1236 _1237 _1238 _1239 _1241 _1242 _1243 _1244 _1245 _1247 _1249 _1250 _1251 _1252 _1253 _1255 _1256 _1257 _1258 _1260 _1261 _1262 _1263 _1264 _1265 _1266 _1267 _1268 _1269 _1270 _1271 _1272 _1273 _1274 _1275 _1276 _1277 _1278 _1279 _1280 _1281 _1282 _1283 _1284 _1285 _1286 _1287 _1288 _1289 _1290 _1291 _1292 _1293 _1294 _1295 _1296 _1297 _1298 _1299 _1300 _1301 _1302 _1303 _1304 _1305 _1306 _1307 _1308 _1309 _1310 _1311 _1312 _1313 _1314 _1315 _1316 _1317 _1318 _1319 _1320 _1321 _1322 _1323 _1324 _1325 _1326 _1327 _1328 _1329 _1330 _1331 _1332 _1333 _1334 _1335 _1336 _1337 _1338 _1339 _1340 _1341 _1342 _1343 _1344 _1345 _1346 _1347 _1348 _1349 _1350 _1351 _1352 _1353 _1354 _1355 _1356 _1357 _1358 _1359 _1360 _1361 _1362 _1363 _1364 _1365 _1366 _1367 _1368 _1369 _1370 _1371 _1372 _1373 _1374 _1375 _1376 _1377 _1378 _1379 _1380 _1381 _1382 _1383 _1384 _1385 _1386 _1387 _1388 _1389 _1390 _1391 _1392 _1393 _1394 _1395 _1396 _1397 _1398 _1399 _1400 _1401 _1402 _1403 _1404 _1405 _1406 _1407 _1408 _1409 _1410 _1411 _1412 _1413 _1414 _1415 _1416 _1417 _1418 _1419 _1420 _1421 _1422 _1423 _1424 _1425 _1426 _1427 _1428 _1430 _1431 _1432 _1433 _1434 _1435 _1436 _1437 _1438 _1439 _1440 _1441 _1442 _1443 _1444 _1445 _1446 _1447 _1448 _1449 _1450 _1451 _1452 _1453 _1454 _1455 _1456 _1457 _1458 _1459 _1460 _1461 _1462 _1463 _1464 _1465 _1466 _1467 _1468 _1469 _1470 _1471 _1472 _1473 _1474 _1475 _1476 _1477 _1478 _1479 _1480 _1481 _1482 _1483 _1484 _1485 _1486 _1487 _1488 _1489 _1491 _1490 _1492 _1493 _818 _1494 _1495 _1496 _1497 _1499 _1498 _1501 _1502 _1503 _1504 _1505 _1506 _1507 _1508 _1509 _1510 _1512 _1513 _1514 _1515 _1516 _1517 _1518 _1519 _1520 _1521 _1522 _1523 _1525 _1524 _1526 _1527 _1528 _1529 _1530 _1531 _1532 _1533 _1534 _1535 _1536 _1537 _1538 _1539 _1540 _1541 _1542 _1543 _1544 _1545 _1546 _1547 _1548 _1549 _1550 _1551 _1552 _1553 _1554 _1555 _1556 _1557 _1558 _1559 _1560 _1562 _1563 _1564 _1565 _1566 _1567 _1568 _1569 _1570 _1571 _1573 _1574 _1575 _1576 _1577 _1578 _1579 _1580 _1581 _1582 _1583 _1584 _1585 _1586 _1587 _1588 _1589 _1590 _1591 _1592 _1593 _1594 _1561 _1595 _1596 _1597 _1598 _1599 _1600 _1601 _1602 _1603 _1604 _1605 _1606 _1607 _1608 _1609 _1610 _1611 _1612 _1613 _1614 _1615 _1616 _1617 _1618 _1619 _1620 _1621 _1622 _1623 _1624 _1625 _1626 _1627 _1628 _1629 _1630 _1631 _1632 _1633 _1634 _1635 _1636 _1637 _1638 _1639 _1640 _1641 _1642 _1643 _1644 _1645 _1646 _1647 _1648 _1649 _1650 _1651 _1652 _1653 _1654 _1655 _1656 _1657 _1658 _1659 _1660 _1661 _1662 _1663 _1664 _1665 _1666 _1667 _1668 _1669 _1670 _1671 _1672 _1673 _1674 _1675 _1676 _1677 _1678 _1679 _1680 _1681 _1682 _1683 _1684 _1685 _1686 _1687 _1688 _1689 _1690 _1691 _1692 _1693 _1694 _1695 _1696 _1697 _1698 _1699 _1700 _1701 _1702 _1703 _1704 _1705 _1706 _1707 _1708 _1709 _1710 _1711 _1712 _1713 _1714 _1715 _1716 _1717 _1718 _1719 _1720 _1721 _1722 _1723 _1724 _1725 _1726 _1727 _1728 _1729 _1730 _1731 _1732 _1733 _1734 _1735 _1736 _1737 _1738 _1739 _1740 _1741 _1742 _1743 _1744 _1745 _1746 _1747 _1748 _1749 _1750 _1751 _1752 _1753 _1754 _1755 _1756 _1757 _1758 _1759 _1760 _1761 _1762 _1763 _1764 _1765 _1766 _1767 _1768 _1769 _1770 _1771 _1772 _1773 _1774 _1775 _1776 _1777 _1778 _1779 _1780 _1781 _1782 _1783 _1784 _1785 _1786 _1787 _1788 _1789 _1790 _1791 _1792 _1793 _1794 _1795 _1796 _1797 _1798 _1799 _1800 _1801 _1802 _1803 _1804 _1805 _1806 _1807 _1808 _1809 _1810 _1811 _1812 _1813 _1814 _1815 _1816 _1817 _1818 _1819 _1820 _1821 _1822 _1823 _1824 _1825 _1826 _1827 _1828 _1829 _1830 _1831 _1832 _1833 _1834 _1835 _1836 _1837 _1838 _1839 _1840 _1841 _1842 _1843 _1844 " mangled="_Z2::" demangled="::"/> - <Namespace id="_2" name="std" context="_1" members="_1846 _1847 _1848 _1849 _1850 _1851 _1852 _1853 _1854 _1855 _1856 _1857 _1858 _1859 _1860 _1861 _1862 _1863 _1864 _1865 _1866 _1867 _1868 _1869 _1870 _1871 _1872 _1873 _1874 _1875 _1876 _1877 _1878 _1879 _1880 _1881 _1882 _1883 _1884 _1885 _1886 _1887 _1888 _1889 _1890 _1891 _1892 _1893 _1894 _1895 _1900 _1901 _1906 _1907 _1920 _1921 _1926 _1927 _1932 _1933 _1934 _1935 _1936 _1937 _1938 _1939 _1940 _1941 _1942 _1956 _1957 _1958 _1959 _1960 _1961 _1962 _1963 _1964 _1965 _1968 _1973 _1974 _1975 _1976 _1981 _1982 _1983 _1984 _1987 _1988 _1989 _1990 _1991 _1992 _1993 _1994 _1995 _1996 _1997 _2006 _2007 _2008 _2039 _2048 _2049 _2050 _2051 _2052 _2053 _2054 _2055 _2056 _2057 _2058 _2059 _2060 _2061 _2062 _2063 _2064 _2065 _2066 _2067 _2068 _2069 _2070 _2071 _2072 _2073 _2074 _2075 _2076 _2077 _2078 _2079 _2080 _2081 _2082 _2083 _2084 _2085 _2086 _2087 _2088 _2089 _2090 _2091 _2092 _2093 _2094 _2100 _2101 _2142 _2143 _2144 _2162 _2163 _2203 _2205 _2206 _2207 _2268 _2281 _2290 _2307 _2308 _2313 _2315 _2316 _2317 _2324 _2325 _2326 _2449 _2450 _2451 _2452 _2453 _2454 _2455 _2456 _2457 _2459 _2461 _2463 _2465 _2467 _2469 _2471 _2473 _2475 _2477 _2479 _2481 _2483 _2485 _2487 _2489 _2491 _2493 _2495 _2497 _2499 _2501 _2503 _2505 _2507 _2509 _2510 _2515 _2516 _2517 _2518 _2519 _2520 _2521 _2522 _2523 _2524 _2525 _2526 _2527 _2528 _2530 _2531 _2532 _2533 _2534 _2535 _2536 _2537 _2538 _2540 _2542 _2561 _2562 _2563 _2564 _2565 _2566 _2567 _2568 _2569 _2632 _2633 _2634 _2635 _2636 _2637 _2638 _2647 _2648 _2649 " mangled="_Z3std" demangled="std"/> - <Function id="_3" name="_GLOBAL__D__home_roman_pygccxml_sources_sources_pyplusplus_dev_examples_pyboost_dev_dev_date_time_include_date_time.pypp.hppWwecHb" returns="_1154" context="_1" location="f0:131" file="f0" line="131" endline="131"/> - <Function id="_4" name="_GLOBAL__I__home_roman_pygccxml_sources_sources_pyplusplus_dev_examples_pyboost_dev_dev_date_time_include_date_time.pypp.hppWwecHb" returns="_1154" context="_1" location="f0:131" file="f0" line="131" endline="131"/> + <Namespace id="_1" name="::" members="_3 _4 _5 _6 _7 _8 _9 _10 _11 _12 _13 _14 _15 _16 _17 _18 _19 _20 _21 _22 _23 _24 _25 _26 _27 _28 _29 _30 _31 _32 _33 _34 _35 _36 _37 _38 _39 _40 _41 _42 _43 _44 _45 _46 _47 _48 _49 _50 _51 _52 _53 _54 _55 _56 _57 _58 _59 _60 _61 _62 _63 _64 _65 _66 _67 _68 _69 _70 _71 _72 _73 _74 _75 _76 _77 _78 _79 _80 _81 _82 _83 _84 _85 _86 _87 _88 _89 _90 _91 _92 _93 _94 _95 _96 _97 _98 _99 _100 _101 _102 _103 _104 _105 _106 _107 _108 _109 _110 _111 _112 _113 _114 _115 _116 _117 _118 _119 _120 _121 _122 _123 _124 _125 _126 _127 _128 _129 _130 _131 _132 _133 _134 _135 _136 _137 _138 _139 _140 _141 _142 _143 _144 _145 _146 _147 _148 _149 _150 _151 _152 _153 _154 _155 _156 _157 _158 _159 _160 _161 _162 _163 _164 _165 _166 _167 _168 _169 _170 _171 _172 _173 _174 _175 _176 _177 _178 _179 _180 _181 _182 _183 _184 _185 _186 _187 _188 _189 _190 _191 _192 _193 _194 _195 _196 _197 _198 _199 _200 _201 _202 _203 _204 _205 _206 _207 _208 _209 _210 _211 _212 _213 _214 _215 _216 _217 _218 _219 _220 _221 _222 _223 _224 _225 _226 _227 _228 _229 _230 _231 _232 _233 _234 _235 _236 _237 _238 _239 _240 _241 _242 _243 _244 _245 _246 _247 _248 _249 _250 _251 _252 _253 _254 _255 _256 _257 _258 _259 _260 _261 _262 _263 _264 _265 _266 _267 _268 _269 _270 _271 _272 _273 _274 _275 _276 _277 _278 _279 _280 _281 _282 _283 _284 _285 _286 _287 _288 _289 _290 _291 _292 _293 _294 _295 _296 _297 _298 _299 _300 _301 _302 _303 _304 _305 _306 _307 _308 _309 _310 _311 _312 _313 _314 _315 _316 _317 _318 _319 _320 _321 _322 _323 _324 _325 _326 _327 _328 _329 _330 _331 _332 _333 _334 _335 _336 _337 _338 _339 _340 _341 _342 _343 _344 _345 _346 _347 _348 _349 _350 _351 _352 _353 _354 _355 _356 _357 _358 _359 _360 _361 _362 _363 _364 _365 _366 _367 _368 _369 _370 _371 _372 _373 _374 _375 _376 _377 _378 _379 _380 _381 _382 _383 _384 _385 _386 _387 _388 _389 _390 _391 _392 _393 _394 _395 _396 _397 _398 _399 _400 _401 _402 _403 _404 _405 _406 _407 _408 _409 _410 _411 _412 _413 _414 _415 _416 _417 _418 _419 _420 _421 _422 _423 _424 _425 _426 _427 _428 _429 _430 _431 _432 _433 _434 _435 _436 _437 _438 _439 _440 _441 _442 _443 _444 _445 _446 _447 _448 _449 _450 _451 _452 _453 _454 _455 _456 _457 _458 _459 _460 _461 _462 _463 _464 _465 _466 _467 _468 _469 _470 _471 _472 _473 _474 _475 _476 _477 _478 _479 _480 _482 _483 _484 _485 _486 _487 _488 _489 _490 _491 _492 _493 _494 _495 _496 _497 _498 _499 _501 _502 _503 _504 _505 _506 _508 _509 _510 _511 _512 _513 _514 _515 _516 _517 _518 _519 _520 _521 _522 _523 _524 _525 _526 _527 _528 _529 _530 _531 _532 _533 _534 _535 _536 _537 _538 _539 _540 _541 _542 _543 _544 _545 _546 _547 _548 _549 _550 _551 _552 _553 _554 _555 _556 _557 _558 _559 _560 _561 _562 _563 _564 _565 _566 _567 _568 _569 _570 _571 _572 _573 _574 _575 _576 _577 _578 _579 _580 _581 _582 _583 _584 _585 _586 _587 _588 _589 _590 _591 _592 _593 _594 _595 _596 _597 _598 _599 _600 _601 _602 _603 _604 _605 _606 _607 _608 _609 _610 _611 _612 _613 _614 _615 _616 _617 _618 _619 _621 _622 _623 _624 _625 _626 _627 _628 _629 _630 _631 _632 _633 _634 _635 _636 _638 _639 _640 _641 _642 _643 _644 _645 _646 _647 _648 _649 _650 _651 _652 _653 _654 _655 _656 _657 _658 _659 _660 _661 _662 _663 _664 _665 _666 _667 _668 _669 _670 _671 _672 _673 _674 _675 _676 _677 _678 _679 _680 _681 _682 _683 _684 _685 _686 _687 _688 _689 _690 _691 _692 _693 _694 _695 _696 _697 _698 _699 _700 _701 _702 _703 _704 _705 _706 _707 _708 _709 _710 _711 _712 _713 _714 _715 _716 _717 _718 _719 _720 _721 _722 _723 _724 _725 _72... [truncated message content] |
From: <rom...@us...> - 2006-06-02 18:17:56
|
Revision: 194 Author: roman_yakovenko Date: 2006-06-02 11:17:50 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=194&view=rev Log Message: ----------- updating documentation Modified Paths: -------------- pygccxml_dev/docs/history/history.rest Modified: pygccxml_dev/docs/history/history.rest =================================================================== --- pygccxml_dev/docs/history/history.rest 2006-05-31 20:34:41 UTC (rev 193) +++ pygccxml_dev/docs/history/history.rest 2006-06-02 18:17:50 UTC (rev 194) @@ -8,42 +8,42 @@ Contributors ------------ -Thanks to all the people that have contributed patches, bug reports and suggestions. -Source code and documentation have been contributed by +Thanks to all the people that have contributed patches, bug reports and suggestions: * My wife - Yulia - * John Pallister <jo...@sy...> + * John Pallister * Matthias Baas * Allen Bierbaum - ------------ -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. - + * Georgiy Dernovoy + +----------- +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. -9. Native java types has been added to fundamental types. +9. Native java types has been added to fundamental types. ------------- Version 0.7.1 @@ -54,107 +54,107 @@ 1. New fundamental types has been added * complex float - + * complex double - * complex long 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, + 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. + * *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 +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 + 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. +1. Small bug has been fixed. ------------- Version 0.6.7 @@ -163,44 +163,44 @@ 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: - + .. 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 - +4. There are new properties on + * *declarations.declaration_t.top_parent* - - * *declarations.class_t.recursive_bases* returns all base classes of the + + * *declarations.class_t.recursive_bases* returns all base classes of the class - - * *declarations.class_t.recursive_derived* returns all derived classes of + + * *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 +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 + +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`_ + 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. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-31 20:34:58
|
Revision: 193 Author: roman_yakovenko Date: 2006-05-31 13:34:41 -0700 (Wed, 31 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=193&view=rev Log Message: ----------- updating documentation and adding few examples Modified Paths: -------------- pyplusplus_dev/docs/examples/boost/boost.rest pyplusplus_dev/examples/pyboost_dev/dev/rational/generate_code.py pyplusplus_dev/examples/pyboost_dev/pyboost/rational/__init__.py Added Paths: ----------- pyplusplus_dev/examples/pyboost_dev/crc_example.py pyplusplus_dev/examples/pyboost_dev/random_example.py pyplusplus_dev/examples/pyboost_dev/rational_example.py Modified: pyplusplus_dev/docs/examples/boost/boost.rest =================================================================== --- pyplusplus_dev/docs/examples/boost/boost.rest 2006-05-31 20:32:46 UTC (rev 192) +++ pyplusplus_dev/docs/examples/boost/boost.rest 2006-05-31 20:34:41 UTC (rev 193) @@ -67,16 +67,100 @@ pyboost package --------------- -... +Documentation +------------- +Right now, pyboost package does not have a documentation. In my opinion it is +fairly simple to read original documentation and "translate" it to Python. + +Examples -------- + +random +~~~~~~ + +* C++ code: http://boost.org/libs/random/index.html + +* Python code: + + :: + + import time + from pyboost import boost_random + | + rng = boost_random.mt19937( int( time.time() ) ) #setting initial seed + six = boost_random.uniform_int(1,6) + die = boost_random.variate_generator( rng, six ) + | + print die() + +rational +~~~~~~~~ + +* C++ code: http://boost.org/libs/rational/rational_example.cpp + +* Python code: + + :: + + import unittest + from pyboost import rational + + + half = rational.rational( 1, 2 ) + one = rational.rational( 1 ) + two = rational.rational( 2 ) + + + #Some basic checks + assert half.numerator() == 1 + assert half.denominator() == 2 + assert float(half) == 0.5 + + + #Arithmetic + assert half + half == one == 1 + assert one - half == half + assert two * half == one == 1 + assert one / half == two == 2 + + +crc +~~~ + +* C++ code: http://boost.org/libs/crc/crc_example.cpp + +* Python code: + + :: + + import os + import sys + from pyboost import crc + + + if __name__ == '__main__': + if sys.argv: + files = sys.argv + else: + files = [ sys.executable ] + + try: + result = crc.crc_32_type() + for file_name in files: + ifs = file( file_name, 'rb' ) + for line in ifs: + result.process_bytes( line ) + print hex( result.checksum() ).upper() + except Exception, error: + sys.stderr.write( "Found an exception with'%s'%s" %( str( error ), os.linesep ) ) + sys.exit( 1 ) + +-------- Download -------- http://sourceforge.net/project/showfiles.php?group_id=118209. - -I am going to continue development of the `Python`_ bindings for -`boost.date_time`_ library. .. _`boost.date_time` : http://boost.org/doc/html/date_time.html Added: pyplusplus_dev/examples/pyboost_dev/crc_example.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/crc_example.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/crc_example.py 2006-05-31 20:34:41 UTC (rev 193) @@ -0,0 +1,20 @@ +import os +import sys +from pyboost import crc + +if __name__ == '__main__': + if sys.argv: + files = sys.argv + else: + files = [ sys.executable ] + + try: + result = crc.crc_32_type() + for file_name in files: + ifs = file( file_name, 'rb' ) + for line in ifs: + result.process_bytes( line ) + print hex( result.checksum() ).upper() + except Exception, error: + sys.stderr.write( "Found an exception with'%s'%s" %( str( error ), os.linesep ) ) + sys.exit( 1 ) Modified: pyplusplus_dev/examples/pyboost_dev/dev/rational/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/dev/rational/generate_code.py 2006-05-31 20:32:46 UTC (rev 192) +++ pyplusplus_dev/examples/pyboost_dev/dev/rational/generate_code.py 2006-05-31 20:34:41 UTC (rev 193) @@ -19,6 +19,8 @@ // http://www.boost.org/LICENSE_1_0.txt) """ +#TODO: for some reason unary - was not exported + class code_generator_t(object): def __init__(self): module_builder.set_logger_level( logging.INFO ) Modified: pyplusplus_dev/examples/pyboost_dev/pyboost/rational/__init__.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/rational/__init__.py 2006-05-31 20:32:46 UTC (rev 192) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/rational/__init__.py 2006-05-31 20:34:41 UTC (rev 193) @@ -9,6 +9,7 @@ from _rational_ import rational from _rational_ import lcm from _rational_ import gcd +from _rational_ import bad_rational rational.__abs__ = _rational_.abs rational.__float__ = _rational_.to_double Added: pyplusplus_dev/examples/pyboost_dev/random_example.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/random_example.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/random_example.py 2006-05-31 20:34:41 UTC (rev 193) @@ -0,0 +1,8 @@ +import time +from pyboost import boost_random + +rng = boost_random.mt19937( int( time.time() ) ) #setting initial seed +six = boost_random.uniform_int(1,6) +die = boost_random.variate_generator( rng, six ) + +print die() \ No newline at end of file Added: pyplusplus_dev/examples/pyboost_dev/rational_example.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/rational_example.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/rational_example.py 2006-05-31 20:34:41 UTC (rev 193) @@ -0,0 +1 @@ +import unittest from pyboost import rational half = rational.rational( 1, 2 ) one = rational.rational( 1 ) two = rational.rational( 2 ) #Some basic checks assert half.numerator() == 1 assert half.denominator() == 2 assert float(half) == 0.5 #Arithmetic assert half + half == one == 1 assert one - half == half assert two * half == one == 1 assert one / half == two == 2 \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-31 20:32:52
|
Revision: 192 Author: roman_yakovenko Date: 2006-05-31 13:32:46 -0700 (Wed, 31 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=192&view=rev Log Message: ----------- fixing bug Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/filters.py Modified: pygccxml_dev/pygccxml/declarations/filters.py =================================================================== --- pygccxml_dev/pygccxml/declarations/filters.py 2006-05-31 07:41:23 UTC (rev 191) +++ pygccxml_dev/pygccxml/declarations/filters.py 2006-05-31 20:32:46 UTC (rev 192) @@ -353,6 +353,8 @@ def __compare_types( self, type_or_str, type ): assert type_or_str + if type is None: + return False if isinstance( type_or_str, cpptypes.type_t ): if type_or_str != type: return False This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |