diff options
-rw-r--r-- | include/gras/block.i | 4 | ||||
-rw-r--r-- | include/gras/element.i | 1 | ||||
-rw-r--r-- | include/gras/hier_block.i | 1 | ||||
-rw-r--r-- | include/gras/top_block.i | 1 | ||||
-rw-r--r-- | python/gras/CMakeLists.txt | 8 | ||||
-rw-r--r-- | python/gras/GRAS_Block.i | 4 | ||||
-rw-r--r-- | python/gras/GRAS_Element.i | 4 | ||||
-rw-r--r-- | python/gras/GRAS_HierBlock.i | 4 | ||||
-rw-r--r-- | python/gras/GRAS_PyHierBlocks.i | 3 | ||||
-rw-r--r-- | python/gras/GRAS_TopBlock.i | 4 |
10 files changed, 23 insertions, 11 deletions
diff --git a/include/gras/block.i b/include/gras/block.i index 7e06241..ffb361c 100644 --- a/include/gras/block.i +++ b/include/gras/block.i @@ -9,7 +9,6 @@ #include <gras/block.hpp> %} -%include <gras/exception.i> %import <gras/element.i> %import <gras/tags.i> %include <gras/tag_iter.i> @@ -22,6 +21,9 @@ //////////////////////////////////////////////////////////////////////// // Create pythonic gateway to get and set //////////////////////////////////////////////////////////////////////// +%pythoncode %{ +from PMC import * +%} %extend gras::Block { %insert("python") diff --git a/include/gras/element.i b/include/gras/element.i index c150e4b..f8248f8 100644 --- a/include/gras/element.i +++ b/include/gras/element.i @@ -24,7 +24,6 @@ namespace gras //////////////////////////////////////////////////////////////////////// %include <std_string.i> %include <gras/gras.hpp> -%include <gras/exception.i> %include <gras/element.hpp> //////////////////////////////////////////////////////////////////////// diff --git a/include/gras/hier_block.i b/include/gras/hier_block.i index 4c9fc70..c33156f 100644 --- a/include/gras/hier_block.i +++ b/include/gras/hier_block.i @@ -9,7 +9,6 @@ #include <gras/hier_block.hpp> %} -%include <gras/exception.i> %import <gras/element.i> %include <gras/hier_block.hpp> diff --git a/include/gras/top_block.i b/include/gras/top_block.i index 040ed7c..cda01de 100644 --- a/include/gras/top_block.i +++ b/include/gras/top_block.i @@ -9,7 +9,6 @@ #include <gras/top_block.hpp> %} -%include <gras/exception.i> %include <gras/gras.hpp> %include <gras/block_config.hpp> %import <gras/element.i> diff --git a/python/gras/CMakeLists.txt b/python/gras/CMakeLists.txt index 221950d..8a301d0 100644 --- a/python/gras/CMakeLists.txt +++ b/python/gras/CMakeLists.txt @@ -20,10 +20,10 @@ file(GLOB GR_SWIG_SOURCE_DEPS "${GRAS_SOURCE_DIR}/include/gras/*.i") GR_SWIG_MAKE(GRAS_Tags GRAS_Tags.i) GR_SWIG_MAKE(GRAS_TimeTag GRAS_TimeTag.i) -GR_SWIG_MAKE(GRAS_Element ../../include/gras/element.i) -GR_SWIG_MAKE(GRAS_Block ../../include/gras/block.i) -GR_SWIG_MAKE(GRAS_HierBlock ../../include/gras/hier_block.i) -GR_SWIG_MAKE(GRAS_TopBlock ../../include/gras/top_block.i) +GR_SWIG_MAKE(GRAS_Element GRAS_Element.i) +GR_SWIG_MAKE(GRAS_Block GRAS_Block.i) +GR_SWIG_MAKE(GRAS_HierBlock GRAS_HierBlock.i) +GR_SWIG_MAKE(GRAS_TopBlock GRAS_TopBlock.i) GR_SWIG_MAKE(GRAS_PyBlock GRAS_PyBlock.i) GR_SWIG_MAKE(GRAS_PyHierBlocks GRAS_PyHierBlocks.i) GR_SWIG_MAKE(GRAS_ThreadPool GRAS_ThreadPool.i) diff --git a/python/gras/GRAS_Block.i b/python/gras/GRAS_Block.i new file mode 100644 index 0000000..0b857d2 --- /dev/null +++ b/python/gras/GRAS_Block.i @@ -0,0 +1,4 @@ +// Copyright (C) by Josh Blum. See LICENSE.txt for licensing information. + +%include <gras/exception.i> +%include <gras/block.i> diff --git a/python/gras/GRAS_Element.i b/python/gras/GRAS_Element.i new file mode 100644 index 0000000..1cd0d14 --- /dev/null +++ b/python/gras/GRAS_Element.i @@ -0,0 +1,4 @@ +// Copyright (C) by Josh Blum. See LICENSE.txt for licensing information. + +%include <gras/exception.i> +%include <gras/element.i> diff --git a/python/gras/GRAS_HierBlock.i b/python/gras/GRAS_HierBlock.i new file mode 100644 index 0000000..d753c95 --- /dev/null +++ b/python/gras/GRAS_HierBlock.i @@ -0,0 +1,4 @@ +// Copyright (C) by Josh Blum. See LICENSE.txt for licensing information. + +%include <gras/exception.i> +%include <gras/hier_block.i> diff --git a/python/gras/GRAS_PyHierBlocks.i b/python/gras/GRAS_PyHierBlocks.i index a769e2b..9f01397 100644 --- a/python/gras/GRAS_PyHierBlocks.i +++ b/python/gras/GRAS_PyHierBlocks.i @@ -137,10 +137,7 @@ struct HierBlockPython : HierBlock //////////////////////////////////////////////////////////////////////// %pythoncode %{ -from GRAS_Element import Element - def to_element(obj): - if isinstance(obj, Element): return obj try: elem = obj.to_element() set_weak_py_self(elem, obj) diff --git a/python/gras/GRAS_TopBlock.i b/python/gras/GRAS_TopBlock.i new file mode 100644 index 0000000..10d1989 --- /dev/null +++ b/python/gras/GRAS_TopBlock.i @@ -0,0 +1,4 @@ +// Copyright (C) by Josh Blum. See LICENSE.txt for licensing information. + +%include <gras/exception.i> +%include <gras/top_block.i> |