[C++-sig] Py++: absolute or relative PATH for parsed files

Roman Yakovenko roman.yakovenko at gmail.com
Tue Jun 19 19:53:58 CEST 2007


On 6/19/07, Adrien Saladin <adrien-ml at wizzi.net> wrote:
> Hello,
>
> I am switching from Pyste to Py++ for my project. Thanks for this great
tool !
> (and for boost python of course).

Thanks for nice words, but I cannot take credit for Boost.Python. David
Abrahams and others are "the guilty party" :-)

> I still have some problem with absolute and relative file paths:
>
> I have a file called "all.h" which only contains #include directives for
the
> other .h files.
>
> In the Py++ driver file, when I use this first line, the bindings are
> generated:
> mb =
module_builder.module_builder_t(files=[r"/nfs/to/my/home/Src/Tests/Python/Py++/all.h"])
>
> As this way is not portable because of the absolte path, I just cut this
line
> to
> mb = module_builder.module_builder_t(files=[r"all.h"])
>
> and now the generated module is empty in my example directory.
> I attached files needed to reproduce the problem.
>
> What am I doing wrong ?
> Sorry if this question is trivial.

No the question is not trivial, Py++ has this usability bug that I should
fix and I will do for next release.
Read "Caveats" section in the document:
http://www.language-binding.net/pyplusplus/documentation/best_practices.html

Another solution is to use include\exclude functionality to define subset of
declarations you want to export:
mb = module_builder.module_builder_t(files=[r"all.h"])
mb.namespace( 'PTools' ).include() #this will expose all declaration from
the namespace

HTH

P.S. Thanks for bug reporting.

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20070619/0559541e/attachment.htm>


More information about the Cplusplus-sig mailing list