Re: [pygccxml-development] More questions on the Ogre Binding
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2006-05-30 04:56:35
|
On 5/30/06, Lakin Wecker <lak...@gm...> wrote:
> Well, if I hadn't made a typo, that approach would have worked.
> Fortunately for me, the compiler reminded me that all of these members
> aren't in the Ogre::Vector3 namespace, but rather in the
> Ogre::%(parent_name)s namespace.
> The updated code (which actually works and produces code that
> compiles) looks like:
>
> def fix_unnamed_classes (mb):
> ogre_ns = mb.namespace ('Ogre')
> print len (ogre_ns.classes ('')) / 2
>
> for unnamed_cls in ogre_ns.classes( '' ):
> named_parent = unnamed_cls.parent
> if not named_parent.name:
> named_parent = named_parent.parent
>
> for mvar in unnamed_cls.public_members:
> if not mvar.name:
> continue
> named_parent.add_code(
> 'add_property( "%(mvar)s", &Ogre::%(parent)s::%(mvar)s)' \
> % dict( mvar=mvar.name,
> parent=named_parent.name ) )
Thank you!
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|