Files
pybindgen/examples/cross_module_inheritance/Agen.py
T
Mike Owen 37dcfcb514 Adding the beginnings of an example for cross module inheritance. Not
building yet 'cause I don't  understand waf.  Why does every project I
look at use a different build system!
2012-12-10 23:26:25 -08:00

19 lines
451 B
Python

from pybindgen import *
from ModuleGenerationFactory import *
# Module
mod = Module("A")
mod.add_include('"classes.hh"')
# Base
mod.begin_section("A_BaseBindings")
Base = mod.add_class("Base", allow_subclassing = True)
Base.add_constructor([])
Base.add_method("do_something", None, [], is_virtual=True)
mod.end_section("A_BaseBindings")
# Generate the code.
out = ModuleGenerationFactory("A.C", ["BaseBindings"])
mod.generate(out, "A")
out.close()