summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJosh Blum2012-10-31 22:20:12 -0700
committerJosh Blum2012-10-31 22:20:12 -0700
commitaada7e59438fef376bf839a67a574810d1c007e5 (patch)
treee6f59b9555b0ef8165102f5bc684310c24402459 /python
parent61bd98faa4d10a4791669f4f1c196268a6178a4e (diff)
downloadsandhi-aada7e59438fef376bf839a67a574810d1c007e5.tar.gz
sandhi-aada7e59438fef376bf839a67a574810d1c007e5.tar.bz2
sandhi-aada7e59438fef376bf839a67a574810d1c007e5.zip
work on swig and import unit test
Diffstat (limited to 'python')
-rw-r--r--python/gras/CMakeLists.txt1
-rw-r--r--python/gras/GRASElements.i16
2 files changed, 6 insertions, 11 deletions
diff --git a/python/gras/CMakeLists.txt b/python/gras/CMakeLists.txt
index cd0c9be..5386096 100644
--- a/python/gras/CMakeLists.txt
+++ b/python/gras/CMakeLists.txt
@@ -15,6 +15,7 @@ find_package(Boost) #for headers
########################################################################
list(APPEND GR_SWIG_INCLUDE_DIRS ${GRAS_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
+set(GR_SWIG_LIBRARIES gras)
GR_SWIG_MAKE(GRASElements GRASElements.i)
GR_SWIG_INSTALL(
diff --git a/python/gras/GRASElements.i b/python/gras/GRASElements.i
index 1217ae8..12854a9 100644
--- a/python/gras/GRASElements.i
+++ b/python/gras/GRASElements.i
@@ -34,15 +34,11 @@
}
%{
-
-#include <gras/element.hpp>
#include <gras/hier_block.hpp>
#include <gras/top_block.hpp>
#include <gras/io_signature.hpp>
-
%}
-
////////////////////////////////////////////////////////////////////////
//helps with funny swig error for io signature
////////////////////////////////////////////////////////////////////////
@@ -55,10 +51,7 @@
////////////////////////////////////////////////////////////////////////
// pull in hier and top interface
////////////////////////////////////////////////////////////////////////
-%include <boost_shared_ptr.i>
-%shared_ptr(gras::ElementImpl)
-
-%include <gras/element.hpp>
+%include <gras/element.i>
%include <gras/hier_block.hpp>
%include <gras/top_block.hpp>
%include <gras/io_signature.hpp>
@@ -138,10 +131,11 @@ class TopBlock(TopBlockPython):
def disconnect(self, *args):
return internal_connect__(TopBlockPython.disconnect, self, *args)
-class HierBlock(HierBlock):
+HierBlockPython = HierBlock
+
+class HierBlock(HierBlockPython):
def __init__(self, *args, **kwargs):
- HierBlock.__init__(self, *args, **kwargs)
- self._hb = self #backwards compat
+ HierBlockPython.__init__(self, *args, **kwargs)
def connect(self, *args):
return internal_connect__(HierBlock.connect, self, *args)