summaryrefslogtreecommitdiff
path: root/include/gras/hier_block.i
blob: 4b617c20345cf151d20bf587021272de45767bc4 (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
31
// 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>
%}

%include <gras/gras.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*/