pygccxml-development Mailing List for C++ Python language bindings (Page 27)
Brought to you by:
mbaas,
roman_yakovenko
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
(6) |
Mar
(160) |
Apr
(96) |
May
(152) |
Jun
(72) |
Jul
(99) |
Aug
(189) |
Sep
(161) |
Oct
(110) |
Nov
(9) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(13) |
Feb
(48) |
Mar
(35) |
Apr
(7) |
May
(37) |
Jun
(8) |
Jul
(15) |
Aug
(8) |
Sep
(2) |
Oct
(1) |
Nov
(2) |
Dec
(38) |
| 2008 |
Jan
(11) |
Feb
(29) |
Mar
(17) |
Apr
(3) |
May
|
Jun
(64) |
Jul
(49) |
Aug
(51) |
Sep
(18) |
Oct
(22) |
Nov
(9) |
Dec
(9) |
| 2009 |
Jan
(28) |
Feb
(15) |
Mar
(2) |
Apr
(11) |
May
(6) |
Jun
(2) |
Jul
(3) |
Aug
(34) |
Sep
(5) |
Oct
(7) |
Nov
(13) |
Dec
(14) |
| 2010 |
Jan
(39) |
Feb
(3) |
Mar
(3) |
Apr
(14) |
May
(11) |
Jun
(8) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(7) |
Apr
|
May
|
Jun
(3) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2016 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2021 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
|
From: Roman Y. <rom...@gm...> - 2007-03-30 17:49:14
|
On 3/30/07, Allen Bierbaum <al...@vr...> wrote: > Last night I added function transformers to my py++ code generation > script. But unfortunately it now looks like I can't use this feature > with boost 1.33.1. It gives this error on compiling: > > In file included from src/python/ben_module/generated/_ben.main.cpp:7: > src/python/ben_module/generated/__call_policies.pypp.hpp:14:58: error: > boost/python/suite/indexing/iterator_range.hpp: No such file or directory > src/python/ben_module/generated/__convenience.pypp.hpp: In function > 'void > pyplusplus::convenience::ensure_uniform_sequence(boost::python::api::object, > pyplusplus::convenience::index_type)': > src/python/ben_module/generated/__convenience.pypp.hpp:46: error: 'len' > is not a member of 'boost::python' > > I am assuming this means that it requires the a customized version of > boost with the new indexing suite that is not part of the standard > boost.python. Is this correct? Is there any way around this? > > It would be very painful for me to tell all my users that they can't use > the standard version of boost that comes with their OS or that they can > get from boost.org. Unless the indexing suite is accepted into > boost.python I don't really think it will ever become an option for me > to use it or any py++ code that requires it. :( > > In the case of the code I am generating, I am only using the FT.output > transformation anyway, so it doesn't even need the indexing suite. Is > there any way that py++ could be a bit smarter and not include the > indexing suite files unless they are needed? Yes. I will try to address the issue in a few days. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
|
From: Alexander E. <new...@st...> - 2007-03-30 15:31:09
|
Roman, I commited a first version of the ide. There was no funcionality added. I checked the gui with ubuntu 6.06. There is by default python 2.4 an wx 2.6 and it has a strange look. What versions are you using? Can we define as requirement python 2.5 and wx 2.8 ? Alexander |
|
From: Allen B. <al...@vr...> - 2007-03-30 13:53:10
|
Last night I added function transformers to my py++ code generation script. But unfortunately it now looks like I can't use this feature with boost 1.33.1. It gives this error on compiling: In file included from src/python/ben_module/generated/_ben.main.cpp:7: src/python/ben_module/generated/__call_policies.pypp.hpp:14:58: error: boost/python/suite/indexing/iterator_range.hpp: No such file or directory src/python/ben_module/generated/__convenience.pypp.hpp: In function 'void pyplusplus::convenience::ensure_uniform_sequence(boost::python::api::object, pyplusplus::convenience::index_type)': src/python/ben_module/generated/__convenience.pypp.hpp:46: error: 'len' is not a member of 'boost::python' I am assuming this means that it requires the a customized version of boost with the new indexing suite that is not part of the standard boost.python. Is this correct? Is there any way around this? It would be very painful for me to tell all my users that they can't use the standard version of boost that comes with their OS or that they can get from boost.org. Unless the indexing suite is accepted into boost.python I don't really think it will ever become an option for me to use it or any py++ code that requires it. :( In the case of the code I am generating, I am only using the FT.output transformation anyway, so it doesn't even need the indexing suite. Is there any way that py++ could be a bit smarter and not include the indexing suite files unless they are needed? -Allen |
|
From: Roman Y. <rom...@gm...> - 2007-03-29 14:48:49
|
Hi all. Please welcome Alexander Eisenhuth, new Py++ developer. Alexander will concentrate on developing new GUI, using wxPython and Boa Constructor. There are few immediate goals: * to create new GUI, with all functionality available in the current one * to add "project management" functionality: save\load * other small and very useful features In long terms I hope that this new GUI will evolve to powerful IDE, which will make possible to expose middle size project without writing single line of code. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
|
From: Roman Y. <rom...@gm...> - 2007-03-28 13:25:41
|
On 3/28/07, Allen Bierbaum <al...@vr...> wrote: > > Roman Yakovenko wrote: > > Allen, I saw announcement of new release of PyPy. It seems that PyPy has > > JIT compiler and many other cool features, that may cause Py++ to run > > quicker. > > > > Do you want( actually has time ) to try it on your project? May be you > > will gain enormous speed up. > > I don't have a lot of time to try it right now, but it does sound > interesting. > > It may be useful to use the new lsprof profiler on py++ and then output > this to a calltree graph to allow a bit more understanding of what is > going on. (see: http://ddaa.net/blog/python/lsprof-calltree) > > Thanks for the tip I will take a look. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
|
From: Allen B. <al...@vr...> - 2007-03-28 13:01:13
|
Roman Yakovenko wrote: > Allen, I saw announcement of new release of PyPy. It seems that PyPy has > JIT compiler and many other cool features, that may cause Py++ to run > quicker. > > Do you want( actually has time ) to try it on your project? May be you > will gain enormous speed up. I don't have a lot of time to try it right now, but it does sound interesting. It may be useful to use the new lsprof profiler on py++ and then output this to a calltree graph to allow a bit more understanding of what is going on. (see: http://ddaa.net/blog/python/lsprof-calltree) -Allen > > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > _______________________________________________ > pygccxml-development mailing list > pyg...@li... > https://lists.sourceforge.net/lists/listinfo/pygccxml-development |
|
From: Roman Y. <rom...@gm...> - 2007-03-28 09:47:57
|
Allen, I saw announcement of new release of PyPy. It seems that PyPy has JIT compiler and many other cool features, that may cause Py++ to run quicker. Do you want( actually has time ) to try it on your project? May be you will gain enormous speed up. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
|
From: Roman Y. <rom...@gm...> - 2007-03-26 09:10:11
|
On 3/26/07, Alexander Eisenhuth <st...@st...> wrote:
> In any case we should seperater gui and logic, but i would prefere MVC.
With
> little changes on the boa code we could reach that. (BOA code is the view)
Fine with me.
> >
> > 2. I attached the screenshot I made at home( Ubuntu linux , laptop), as
> > you can see I am not able to see the whole window. May be we should not
> > use "fixed" width, but some geometry manager?
>
> Yes, there is already a geometry management for the x-direction.(and I'll
> enhance it) The y layout is static for the left side.
Thanks
> >
> > 3. I think we can move buttons to the menu ( Build ) and may be to the
> > tool bar.
> >
> > 4. Py++ GUI looks like it looks, because I don't know Tkinter and did
> > not have time to learn it. If you have some ideas how to rearrange it
> > you are welcome to implement them.
>
> Ok, that's for me a question where will we heading to?
>
> As I searched for my project for language binding I had to decided between
swig
> and boost.python (BP). My API was small and I liked the approach of BP. As
I
> found Py++ I was glad of the GUI, because it showed me very fast the BP
code to
> different "expose questions".
>
> So your solution of the GUI is a very intuitive one and for the use case
of
> BP-Code generation enough. So why hide it in the menue? It's good. For the
UC of
> project management the menue of my proposed solution is very common to
users.
Thank you. I though my GUI was ugly, but if you say it was intuitive and
helpful
than I am not going to argue with you.
> But if you feel, that the Py++ GUI is only at the beginning (I can't
oversee
> that), and you have ideas what are the next steps, then let's discuss it.
As I
> told already my time until August is very limited. So my preview was
something I
> can oversee to implement. But if we find a serious radmap for the GUI I'm
also
> willing to spent more time on the GUI. (maybe later)
My dream is to build full feature IDE.
On top you have menu item with regular functionality:
File: open, close project
Edit: project settings
Build: compile( == create xml ), generate code, generate Py++ code(
optionally )
Help:
On the left side you have declarations tree, with "filter" functionality.
I'd like user to be able to evaluate any python expression or just select
one of the predefined filters.
On the right side you have notetab, with few tabs:
1. the first one shows the selected declarations properties and provide
ability to modify them. Python reflection could be useful here. This also
will display documentation.
2. XML
3. Generated code
At the bottom you have errors, warnings and statistics information.
I think such IDE should give a user all tools he need to handle small-medium
projects.
Alexander this is a fuuuuuuuuutere project. Right now I don't have time for
it. This is definitely not a few weeks project. I prefer we add the
functionality you propose. When and "if" I will work on the IDE I will do
this using different code base.
P.S. I subscribed the pygccxml mailing list too.
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|
|
From: Alexander E. <new...@st...> - 2007-03-20 07:56:23
|
Why? Tony Kirke schrieb: > For GUI, I would recommend PythonCard which is based on wxPython. > |
|
From: Tony K. <tk...@gm...> - 2007-03-19 18:53:17
|
For GUI, I would recommend PythonCard which is based on wxPython. On 3/19/07, Alexander Eisenhuth <new...@st...> wrote: > Hello alltogether, > > I'm willing to contribute some enhancements to the GUI of Py++. The idea behind > the enhancement is to add a little "project management" to the gui. Any comments > or discussion is welcome. > > GUI enhancements: > + Add a Menue bar > + Add File Item: > + Save Project > + Load Project > + Recent Project > + (last projects) > + Context Menue to "Generated code" > + "Select all (Ctrl-A)" > + "Copy (Ctrl+C)" > > Project File: > + XML file > + Name entered by user > + project settings: > + GCC XML-Path (*) > + List of Inc-Paths > + List of Defines > + Generated Code > + Gui Settings > + Geometry > > PY++ GUI configuration: > + XML file > + Name: $(HOME).pyplusplus_gui > + project settings: > + max num projects > + list of recent projects > + path of last project > > (*) I'm not shure weater I should add the GCCXML path to project or to the GUI > config. > Add it to Project File: > + Different GCCXML can be used > Add it to PY++ GUI configuration: > + New version of GCCXML must only be changed once > > What do you mean? > > I haven't used TkInter for now. So I'm at the moment open to other proposals > than Tkinter. > > My thoughts about gui toolkit: > - Good GUI builder are a nice thing, when the generated code can be easily be > integrated (like QtDesigner, boa) > - PyQt and wxPython are good toolkits but a new dependancy to Py++ > - When a change from Tkinter should take place, it should be done now > > > And last: > Does anybody know a GUI builder for Tkinter? > > > Regards > Alexander > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > pygccxml-development mailing list > pyg...@li... > https://lists.sourceforge.net/lists/listinfo/pygccxml-development > |
|
From: Roman Y. <rom...@gm...> - 2007-03-19 18:27:03
|
On 3/19/07, Alexander Eisenhuth <new...@st...> wrote: > Hello alltogether, > > I'm willing to contribute some enhancements to the GUI of Py++. The idea behind > the enhancement is to add a little "project management" to the gui. Any comments > or discussion is welcome. > > GUI enhancements: > + Add a Menue bar > + Add File Item: > + Save Project > + Load Project > + Recent Project > + (last projects) > + Context Menue to "Generated code" > + "Select all (Ctrl-A)" > + "Copy (Ctrl+C)" > > Project File: > + XML file > + Name entered by user > + project settings: > + GCC XML-Path (*) > + List of Inc-Paths > + List of Defines > + Generated Code Why do you think we need this one? > + Gui Settings > + Geometry > > PY++ GUI configuration: > + XML file > + Name: $(HOME).pyplusplus_gui > + project settings: > + max num projects > + list of recent projects > + path of last project > > (*) I'm not shure weater I should add the GCCXML path to project or to the GUI > config. > Add it to Project File: > + Different GCCXML can be used > Add it to PY++ GUI configuration: > + New version of GCCXML must only be changed once I think GCCXML belongs to project file, also you we can implement some logic that will remember last X used GCCXML's. Thus it will be pretty easy to use same project on different machines. Another valid option is to define GCCXML environment variable. You can take a look on "gccxml search algorithm" here: http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pygccxml_dev/pygccxml/parser/source_reader.py?view=markup Take a look on __raise_on_wrong_settings method. > What do you mean? > > I haven't used TkInter for now. So I'm at the moment open to other proposals > than Tkinter. > > My thoughts about gui toolkit: > - Good GUI builder are a nice thing, when the generated code can be easily be > integrated (like QtDesigner, boa) > - PyQt and wxPython are good toolkits but a new dependancy to Py++ > - When a change from Tkinter should take place, it should be done now I thought about this and if you ask me than wxPython and Boa is the way to go. I was not productive with Tkinter. I never used PyQt. Another reason to use wxPython is that it works pretty well with "freeze" tools. It is possible to create stand-alone, with no external dependencies executable. I think what you are going to do is great. Let me know if you need some\\any help from me. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
|
From: Roman Y. <rom...@gm...> - 2007-03-19 12:07:12
|
On 3/18/07, Tony Kirke <tk...@gm...> wrote: > Hi, > When run py++, it creates a __call_policies.pypp.hpp with includes > > #include "boost/python.hpp" > #include "boost/mpl/int.hpp" > #include "boost/function.hpp" > #include "boost/python/suite/indexing/iterator_range.hpp" > #include "boost/python/object/class_detail.hpp" > #include "boost/type_traits/is_same.hpp" > > However > #include "boost/python/suite/indexing/iterator_range.hpp" > is not part of boost_1_33_1 as far as I can tell > How do I resolve this? It depends on what you use from the header. If you use return_range call policy (http://language-binding.net/pyplusplus/documentation/functions/call_policies.html#return-range) Then you have to install indexing suite v2. You can find it under /pyplusplus_dev/indexing_suite_v2 directory. If you don't, than I think I will have to move this call policy to a separate header. Now, when you raised this point I think I unintentionally introduced dependency on new indexing suite :-(. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
|
From: Alexander E. <new...@st...> - 2007-03-19 09:51:02
|
Hello alltogether,
I'm willing to contribute some enhancements to the GUI of Py++. The idea behind
the enhancement is to add a little "project management" to the gui. Any comments
or discussion is welcome.
GUI enhancements:
+ Add a Menue bar
+ Add File Item:
+ Save Project
+ Load Project
+ Recent Project
+ (last projects)
+ Context Menue to "Generated code"
+ "Select all (Ctrl-A)"
+ "Copy (Ctrl+C)"
Project File:
+ XML file
+ Name entered by user
+ project settings:
+ GCC XML-Path (*)
+ List of Inc-Paths
+ List of Defines
+ Generated Code
+ Gui Settings
+ Geometry
PY++ GUI configuration:
+ XML file
+ Name: $(HOME).pyplusplus_gui
+ project settings:
+ max num projects
+ list of recent projects
+ path of last project
(*) I'm not shure weater I should add the GCCXML path to project or to the GUI
config.
Add it to Project File:
+ Different GCCXML can be used
Add it to PY++ GUI configuration:
+ New version of GCCXML must only be changed once
What do you mean?
I haven't used TkInter for now. So I'm at the moment open to other proposals
than Tkinter.
My thoughts about gui toolkit:
- Good GUI builder are a nice thing, when the generated code can be easily be
integrated (like QtDesigner, boa)
- PyQt and wxPython are good toolkits but a new dependancy to Py++
- When a change from Tkinter should take place, it should be done now
And last:
Does anybody know a GUI builder for Tkinter?
Regards
Alexander
|
|
From: Tony K. <tk...@gm...> - 2007-03-18 18:39:46
|
Hi, When run py++, it creates a __call_policies.pypp.hpp with includes #include "boost/python.hpp" #include "boost/mpl/int.hpp" #include "boost/function.hpp" #include "boost/python/suite/indexing/iterator_range.hpp" #include "boost/python/object/class_detail.hpp" #include "boost/type_traits/is_same.hpp" However #include "boost/python/suite/indexing/iterator_range.hpp" is not part of boost_1_33_1 as far as I can tell How do I resolve this? |
|
From: Roman Y. <rom...@gm...> - 2007-03-15 18:50:51
|
On 3/15/07, Fran=E7ois du Vignaud <fra...@ya...> wrote:
>
> Hi Roman,
>
> I have retried using the latest cvs snapshot and it return the same resul=
ts.
> Have you succeeded to reproduce the bug on your side ?
> best regards,
Yes I am. Unfortunately nothing could be done :-(. From time to time
I check option to add another back-end to pygccxml. On Linux I found a
way to get information from source files without gccxml invocation. On
Windows I saw next options:
1. bsckit - MSVC compiler generates "browse source code" files. It
also supplies a library which provides API. The problem with this
approach
is that information is not complete. There is no function argument
types, function exception specification and few other pieces of
critical
information.
2. pdb files - program debug information files. There is API to work
with them, but it is toooooooooo complex and also lacks some critical
information.
3. Use Visual Studio automation to extract information from the source file=
s
( http://msdn2.microsoft.com/en-us/library/envdte.codeclass(VS.80).aspx =
)
I read in the MSVC 8.0 team blog that they use their compiler to
extract information from source files. Using PyWin32 we can work with
MS Visual Studio via COM interface.
4. It is possible to use some other parser( doxygen, SWIG, SIP, synopsys )
5. Your suggestion here...
>From this list I think (3) is the most promising approach and it
should not be too difficult to implement and check it. The problem is
that at home I don't have Windows machine, otherwise I would already
implement it.
It also worse to take a look on http://synopsis.fresco.org/. It uses
Wave - fully complaint C++ preprocessor, but the documentation for the
project almost does not exists.
I'll be glad to know your opinion and suggestions.
--=20
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|
|
From: Roman Y. <rom...@gm...> - 2007-03-13 18:01:24
|
On 3/13/07, Fran=E7ois du Vignaud <fra...@ya...> wrote: > Hi all, > > First of all congratulations for your great work! The possibility to brow= se C++ code using at this level python api is really amazing ! > I'm considering to use it to expose automatically an existing open source= library (QuantLib) to Excel (and later to Python). To do this I need to pa= rse header files and generates the corresponding stub code. Unfortunately g= ccxml fails to parse code when I include the following boost header file: > boost/iterator/reverse_iterator.hpp > Have you ever encountered any difficulties parsing boost headers ? gccxml is built on top of gcc 3.3 I think. It is not able to parse all boost header files as is. Sometimes it needs small help. Can you post the error message? Also I saw few updates of gccxml to MSVC 8.0. May be this could help. I suggest you to try CVS version of GCC-XML. If it works - fine, if not I am sure we will find work around. --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
|
From: <fra...@ya...> - 2007-03-13 14:00:26
|
=0AHi all,=0A=0AFirst of all congratulations for your great work! The possi= bility to browse C++ code using at this level python api is really amazing = ! =0AI'm considering to use it to expose automatically an existing open sou= rce library (QuantLib) to Excel (and later to Python). To do this I need to= parse header files and generates the corresponding stub code. Unfortunatel= y gccxml fails to parse code when I include the following boost header file= :=0Aboost/iterator/reverse_iterator.hpp=0AHave you ever encountered any dif= ficulties parsing boost headers ?=0Abest regards,=0AFran=E7ois=0A=0A=0APS: = I'm using a gccxml build from the gccxml_installer.zip with vc8=0A=0A=0A=0A= =0A=09=09=0A___________________________________________________________ =0A= The all-new Yahoo! Mail goes wherever you go - free your email address from= your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html |
|
From: Roman Y. <rom...@gm...> - 2007-03-12 18:29:47
|
On 3/10/07, Allen Bierbaum <al...@vr...> wrote:
> I think I may have just found a corner case for the auto-detection of
> which exposed class variables should be read_only. I am wrapping a
> class that has a static member variable of a type that does not have an
> op=. I think the idea the class designers had is that this would keep
> someone from assigning to these variables after they are created.
>
> Unfortunately py++ does not detect this case right now and tries to
> expose this variable using def_readwrite instead of def_read. I think
> this could be fixed by adding some logic to
> variable_wrapper.variable_t.__find_out_is_read_only to check for this
case.
Allen I took a look on your problem and I think I need your help to
resolve it.
Here is a full code for __find_out_is_read_only method:
def __find_out_is_read_only(self):
type_ = declarations.remove_alias( self.type )
if isinstance( type_, declarations.const_t ):
return True
if declarations.is_pointer( type_ ):
type_ = declarations.remove_pointer( type_ )
if declarations.is_reference( type_ ):
type_ = declarations.remove_reference( type_ )
if isinstance( type_, declarations.const_t ):
return True
if self.apply_smart_ptr_wa:
return False #all smart pointers has assign operator
if isinstance( type_, declarations.declarated_t ) \
and isinstance( type_.declaration, declarations.class_t ) \
and not declarations.has_public_assign( type_.declaration ):
return True
return False
As you can see the last condition checks exactly what you propose.
So may be you are using old version( I guess the answer is no ) or
you have some interesting use case. In this case I'd like to ask you
to create minimal example, which reproduces the problem.
As a temporal work-around you can set "is_read_only" variable property
to "True"
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|
|
From: Roman Y. <rom...@gm...> - 2007-03-11 07:00:51
|
On 3/10/07, Allen Bierbaum <al...@vr...> wrote: > I think I may have just found a corner case for the auto-detection of > which exposed class variables should be read_only. I am wrapping a > class that has a static member variable of a type that does not have an > op=. I think the idea the class designers had is that this would keep > someone from assigning to these variables after they are created. > > Unfortunately py++ does not detect this case right now and tries to > expose this variable using def_readwrite instead of def_read. I think > this could be fixed by adding some logic to > variable_wrapper.variable_t.__find_out_is_read_only to check for this case. Thank you, I will take a look on this issue -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
|
From: Allen B. <al...@vr...> - 2007-03-10 21:55:03
|
I think I may have just found a corner case for the auto-detection of which exposed class variables should be read_only. I am wrapping a class that has a static member variable of a type that does not have an op=. I think the idea the class designers had is that this would keep someone from assigning to these variables after they are created. Unfortunately py++ does not detect this case right now and tries to expose this variable using def_readwrite instead of def_read. I think this could be fixed by adding some logic to variable_wrapper.variable_t.__find_out_is_read_only to check for this case. -Allen |
|
From: Roman Y. <rom...@gm...> - 2007-03-09 18:37:19
|
On 3/9/07, Birgir Sigurjonsson <Bir...@ro...> wrote:
import os
> from pyplusplus import module_builder
>
In order to use type_traits functionality it is necessary to import
declarations package from pygccxml
from pygccxml import declarations
Sorry, I forgot to write you this
#Creating an instance of class that will help you to expose your
> declarations
> mb = module_builder.module_builder_t(
> ['/home/birgir-s/src/abstractloader.h',
> ]
> , gccxml_path=r""
> ,
> working_directory=r"/home/birgir-s/src"
> ,
> include_paths=['/home/birgir-s/src']
> , define_symbols=[]
> )
>
> mb.decls( lambda decl: 'impl' in decl.name ).exclude()
>
> #mb.print_declarations()
>
> #Creating code creator. After this step you should not modify/customize
> declarations.
> mb.build_code_creator( module_name='pyplusplus' )
>
> all=mb.class_('AbstractLoader')
> extensions=all.mem_fun('extensions')
> rtype=extensions.return_type
> print 'extensions', rtype
> #below will fail as declarations do not exist
> #rtype_cls = declarations.class_traits.get_declaration( rtype )
> #rtype.alias = 'vector_of_strings'
>
Now this will fail for another reason: std::vector< std::string > is class
declaration,
as opposite to class definition. So if you will wrote next 2 lines as:
rtype_cls = declarations.class_declaration_traits.get_declaration( rtype )
rtype.alias = 'vector_of_strings'
This will work.
I also forgot to ask you what version of Py++ pygccxml you use.
Because in order to enjoy from semi automatic aliasing you need
latest version of py++ and pygccxml.
Automatic aliasing:
add next code somewhere in a file, which is passed to gccxml, in global
namespace:
namespace pyplusplus{ namespace aliases{
typedef std::vector < std::string > vvvvvvvv;
}}
Py++ will automaticly pick the name
HTH
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|
|
From: Birgir S. <Bir...@ro...> - 2007-03-09 18:20:52
|
Hei, here is my header file.
#include <boost/utility.hpp>
#include <boost/shared_ptr.hpp>
#include <string>
#include <vector>
class AbstractLoader : private boost::noncopyable {
public:
=0D
AbstractLoader();
virtual ~AbstractLoader();
std::vector < std::string > extensions() const;
=0D
private:
virtual std::vector < std::string > extensions_impl() const =3D 0;
};
But mb.class_() does not find the class gives the following error.
pygccxml.declarations.matcher.declaration_not_found_t: Unable to find=
declaration. matcher: [(decl type=3D=3Dclass_t) and (name=3D=
=3Dstd::vector<std::basic_string<char, std::char_traits<char>,=
std::allocator<char> >,std::allocator<std::basic_string<char,=
std::char_traits<char>, std::allocator<char> > > >)]
This is printed out as the return type from the extensions function.
std::vector<std::basic_string<char, std::char_traits<char>,=
std::allocator<char> >,std::allocator<std::basic_string<char,=
std::char_traits<char>, std::allocator<char> > > >
import os
from pyplusplus import module_builder
#Creating an instance of class that will help you to expose your=
declarations
mb =3D module_builder.module_builder_t(=
['/home/birgir-s/src/abstractloader.h',
]
, gccxml_path=3Dr""=0D
, working_directory=
=3Dr"/home/birgir-s/src"
, include_paths=
=3D['/home/birgir-s/src']
, define_symbols=3D[]
)
mb.decls( lambda decl: 'impl' in decl.name ).exclude()
#mb.print_declarations()
#Creating code creator. After this step you should not modify/customize=
declarations.
mb.build_code_creator( module_name=3D'pyplusplus' )
all=3Dmb.class_('AbstractLoader')
extensions=3Dall.mem_fun('extensions')
rtype=3Dextensions.return_type
print 'extensions', rtype
#below will fail as declarations do not exist
#rtype_cls =3D declarations.class_traits.get_declaration( rtype )
#rtype.alias =3D 'vector_of_strings'
#does not print out the vector class
for m in mb.classes():
print m.name
#this will fail because of vector does not exist as a class
#holder =3D mb.class_( 'std::vector<std::basic_string<char,=
std::char_traits<char>, std::allocator<char>=
>,std::allocator<std::basic_string<char, std::char_traits<char>,=
std::allocator<char> > > >' )
#holder.rename( 'vectof_of_strings' )
#Writing code to file.
mb.write_module( './bindings.cpp')=0D
#mb.split_module('splitted')
Thanks,
Birgir.
-----Original Message-----
From: Roman Yakovenko [mailto:rom...@gm...]
Sent: Fri 3/9/2007 6:31 PM
To: Birgir Sigurjonsson
Cc: pyg...@li...
Subject: Re: [pygccxml-development] Problems with long filename
=0D
On 3/9/07, Birgir Sigurjonsson <Bir...@ro...> wrote:
>
>
>
> Hei, I have tried both method, but no success yet.
>
> 1. when printing out mb.classes() there is not class
> that starts with vector.
>
> 2. in the following example I get an error declarations.
> How do I define the declarations?
>
> al_cls =3D mb.class_( 'AbstractLoader' )
> extensions =3D al_cls.mem_fun( 'extensions' )
> rtype =3D extensions.return_type
> print rtype
> rtype_cls =3D declarations.class_traits.get_declaration( rtype )
> rtype.alias =3D 'vector_of_strings'
May I see your code that reproduce the bug? Something fundamentally
wrong or broken.
At best the example would consist from single header file and Py++ script.
Thanks
--=0D
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
DISCLAIMER:
This message contains information that may be privileged or confidential=
and is the property of the Roxar Group. It is intended only for the person=
to whom it is addressed. If you are not the intended recipient, you are=
not authorised to read, print, retain, copy, disseminate, distribute, or=
use this message or any part thereof. If you receive this message in=
error, please notify the sender immediately and delete all copies of this=
message.=0D |
|
From: Roman Y. <rom...@gm...> - 2007-03-09 17:31:57
|
On 3/9/07, Birgir Sigurjonsson <Bir...@ro...> wrote: > > > > Hei, I have tried both method, but no success yet. > > 1. when printing out mb.classes() there is not class > that starts with vector. > > 2. in the following example I get an error declarations. > How do I define the declarations? > > al_cls = mb.class_( 'AbstractLoader' ) > extensions = al_cls.mem_fun( 'extensions' ) > rtype = extensions.return_type > print rtype > rtype_cls = declarations.class_traits.get_declaration( rtype ) > rtype.alias = 'vector_of_strings' May I see your code that reproduce the bug? Something fundamentally wrong or broken. At best the example would consist from single header file and Py++ script. Thanks -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
|
From: Birgir S. <Bir...@ro...> - 2007-03-09 17:28:21
|
Hei, I have tried both method, but no success yet.
1. when printing out mb.classes() there is not class
that starts with vector.
2. in the following example I get an error declarations.
How do I define the declarations?
=0D
al_cls =3D mb.class_( 'AbstractLoader' )
extensions =3D al_cls.mem_fun( 'extensions' )
rtype =3D extensions.return_type
print rtype
rtype_cls =3D declarations.class_traits.get_declaration( rtype )
rtype.alias =3D 'vector_of_strings'
Thanks for you help,
Birgir.
-----Original Message-----
From: Roman Yakovenko [mailto:rom...@gm...]
Sent: Fri 3/9/2007 3:48 PM
To: Birgir Sigurjonsson
Cc: pyg...@li...
Subject: Re: [pygccxml-development] Problems with long filename
=0D
On 3/9/07, Birgir Sigurjonsson <Bir...@ro...> wrote:
>
> Hei, I cannot get any of those to work, as it seems to me
> that they are based on the fact that I have declared the
> classes.
Strange, I am curious to know why
>
>
>
> I added this
> holder =3D mb.class_( 'std::vector < std::string >')
> holder.rename( 'StringVector' )
>
> and got this error
>
> pygccxml.declarations.matcher.declaration_not_found_t: Unable to find=
declaration. matcher: [(decl type=3D=3Dclass_t) and (name=3D=
=3Dstd::vector < std::string >)
>
> In my case it is the return type (stl container) that
> is beeing auto converted to a class_ by Py++
this is because the name of the class is different. First of all
you've got the class name
first time when you get IOError
Second you can find the exact name of the class in few ways:
1. for x in mb.classes( lambda cls: cls.name.startswith( 'vector<' ) ):
print x.name
2. al_cls =3D mb.class_( 'AbstractLoader' )
extensions =3D al_cls.mem_fun( 'extensions' )
rtype =3D extensions.return_type
print rtype
rtype_cls =3D declarations.class_traits.get_declaration( rtype )
rtype.alias =3D 'vector_of_strings'
> Is there any other way?
Not really, but the solution I described should work
--=0D
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
DISCLAIMER:
This message contains information that may be privileged or confidential=
and is the property of the Roxar Group. It is intended only for the person=
to whom it is addressed. If you are not the intended recipient, you are=
not authorised to read, print, retain, copy, disseminate, distribute, or=
use this message or any part thereof. If you receive this message in=
error, please notify the sender immediately and delete all copies of this=
message.=0D |
|
From: Roman Y. <rom...@gm...> - 2007-03-09 14:48:42
|
On 3/9/07, Birgir Sigurjonsson <Bir...@ro...> wrote:
>
> Hei, I cannot get any of those to work, as it seems to me
> that they are based on the fact that I have declared the
> classes.
Strange, I am curious to know why
>
>
>
> I added this
> holder = mb.class_( 'std::vector < std::string >')
> holder.rename( 'StringVector' )
>
> and got this error
>
> pygccxml.declarations.matcher.declaration_not_found_t: Unable to find declaration. matcher: [(decl type==class_t) and (name==std::vector < std::string >)
>
> In my case it is the return type (stl container) that
> is beeing auto converted to a class_ by Py++
this is because the name of the class is different. First of all
you've got the class name
first time when you get IOError
Second you can find the exact name of the class in few ways:
1. for x in mb.classes( lambda cls: cls.name.startswith( 'vector<' ) ):
print x.name
2. al_cls = mb.class_( 'AbstractLoader' )
extensions = al_cls.mem_fun( 'extensions' )
rtype = extensions.return_type
print rtype
rtype_cls = declarations.class_traits.get_declaration( rtype )
rtype.alias = 'vector_of_strings'
> Is there any other way?
Not really, but the solution I described should work
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|