blob: f89252e6a27e0ea2c06371e0fb90bbe125e728bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright (C) by Josh Blum. See LICENSE.txt for licensing information.
#ifndef INCLUDED_GRAS_HIER_BLOCK_I
#define INCLUDED_GRAS_HIER_BLOCK_I
%module (package="gras") GRAS_HierBlock
%{
#include <gras/hier_block.hpp>
%}
%import <gras/element.i>
%include <gras/hier_block.hpp>
////////////////////////////////////////////////////////////////////////
// Create pythonic methods
////////////////////////////////////////////////////////////////////////
%pythoncode %{
from PMC import *
%}
%extend gras::HierBlock
{
%insert("python")
%{
def __getattr__(self, name):
return lambda *args: self.x(name, *args)
%}
}
#endif /*INCLUDED_GRAS_HIER_BLOCK_I*/
|