[C++-sig] Another problem with split_module

Ganssauge, Gottfried Gottfried.Ganssauge at haufe.de
Fri Sep 29 10:58:25 CEST 2006


> -----Original Message-----
> From: c++-sig-bounces at python.org 
> [mailto:c++-sig-bounces at python.org] On Behalf Of Roman Yakovenko
> Sent: Thursday, September 28, 2006 10:26 PM
> To: Development of Python/C++ integration
> Subject: Re: [C++-sig] Another problem with split_module
> 
> On 9/26/06, Roman Yakovenko <roman.yakovenko at gmail.com> wrote:
> > On 9/26/06, Ganssauge, Gottfried 
> <Gottfried.Ganssauge at haufe.de> wrote:
> > > Hi Roman,
> > >
> > > as you may remember I'm generating function wrappers for 
> functions 
> > > expecting pointers to callback functions along with an instance 
> > > pointer of type void.
> > > How do I make sure these wrappers are generated to the 
> same file as 
> > > the registration of the wrapper?
> >
> > The short answer is: you can not.
> > The long answer: I made some refactoring in order to introduce the 
> > "register opaque type"
> > functionality and it should be very easy to implement what 
> you want to do.
> >
> > I will let you know when this functionality will be ready ( 
> 3 -4  days ).
> 
> Well, it took me less time than I thought. The functionality is ready.
Great.

> 
> mb = module_builder_t( ... )
> mb.free_function( name of the function 
> ).add_declaration_code( your code here )
Is there a reason you omitted the 'tail' argument from this variant of
the function?
I certainly would need it e.g.
	- to make sure includes appear at the head of the generated
module
	- to make sure forward declarations appear before their use
	- ... (you name it :-)
> 
> Enjoy.
I do :-)

> 
> P.S. This time svn contains a lot of changes, also I tested 
> them pretty well I expect few bugs here and their. It could 
> be nice if you can test the latest code.
When running my build script I get the following error:
build.py:346: DeprecationWarning: create_casting_constructor argument is
deprecated and should not be used.
If you still want Py++ to generate implicitly_convertible code, consider
to use allow_implicit_conversion constructor property
mb = module_builder_t(...)
mb.constructors().allow_implicit_conversion = True
  doc_extractor = \
Traceback (most recent call last):
  File "build.py", line 557, in ?
    main (args, of)
  File "build.py", line 535, in main
    mb.build_code_creator ()
  File "build.py", line 346, in build_code_creator
    doc_extractor = \
  File
"/usr/lib/python2.4/site-packages/pyplusplus/module_builder/builder.py",
line 246, in build_code_creator
    , doc_extractor)
  File
"/usr/lib/python2.4/site-packages/pyplusplus/module_creator/creator.py",
line 126, in __init__
    prepared_decls = self._prepare_decls( decls, doc_extractor )
  File
"/usr/lib/python2.4/site-packages/pyplusplus/module_creator/creator.py",
line 160, in _prepare_decls
    readme = filter( lambda msg: msg not in DO_NOT_REPORT_MSGS,
decl.readme() )
  File
"/usr/lib/python2.4/site-packages/pyplusplus/decl_wrappers/decl_wrapper.
py", line 125, in readme
    text.extend( self._readme_impl() )
  File
"/usr/lib/python2.4/site-packages/pyplusplus/decl_wrappers/class_wrapper
.py", line 456, in _readme_impl
    return self.is_wrapper_needed()
  File
"/usr/lib/python2.4/site-packages/pyplusplus/decl_wrappers/class_wrapper
.py", line 427, in is_wrapper_needed
    if self.redefined_funcs():
  File
"/usr/lib/python2.4/site-packages/pyplusplus/decl_wrappers/class_wrapper
.py", line 385, in redefined_funcs
    is_same_function = declarations.is_same_function
AttributeError: 'module' object has no attribute 'is_same_function'

The call in line 346 of build.py is:
        module_builder.module_builder_t.build_code_creator (
            self,
            module_name   = self.module_name,
            doc_extractor = \
                lambda decl, extractor = doc_extractor(): \
                    make_cstring (extractor (decl))

Self is an instance derived from module_builder.module_builder_t.

I don't understand the DeprecationWarning - there is nothing like a
create_casting_constructor argument being used ...

Cheers,

Gottfried

> 
> Thank you.
> 
> --
> Roman Yakovenko
> C++ Python language binding
> http://www.language-binding.net/
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
> 



More information about the Cplusplus-sig mailing list