summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
m---------PMC0
m---------grextras0
-rw-r--r--include/gras/block.i3
-rw-r--r--include/gras/hier_block.i15
-rw-r--r--python/gras/CMakeLists.txt2
6 files changed, 19 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 278941a..fbab4a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,7 +75,6 @@ list(APPEND GRAS_PYTHON_DIRS ${GRAS_BINARY_DIR}/python)
list(APPEND GRAS_PYTHON_DIRS ${GRAS_BINARY_DIR}/python/gras)
list(APPEND GRAS_PYTHON_DIRS ${GRAS_BINARY_DIR}/python/gras/${CMAKE_BUILD_TYPE})
-list(APPEND GRAS_PYTHON_DIRS ${GRAS_SOURCE_DIR}/PMC/python)
list(APPEND GRAS_PYTHON_DIRS ${GRAS_BINARY_DIR}/PMC/python)
list(APPEND GRAS_PYTHON_DIRS ${GRAS_BINARY_DIR}/PMC/python/PMC)
list(APPEND GRAS_PYTHON_DIRS ${GRAS_BINARY_DIR}/PMC/python/PMC/${CMAKE_BUILD_TYPE})
diff --git a/PMC b/PMC
-Subproject bc76568d42c8ec16293313fe02be58b29c8d352
+Subproject f8ff6e55bc7c2dbb698f41196cd3d914a6d0498
diff --git a/grextras b/grextras
-Subproject d4fb7798f3a9fe30a44f3fe719e22fdaa9d8b2f
+Subproject 4f7f4377c18cd0a9b615694ff979b1bae123028
diff --git a/include/gras/block.i b/include/gras/block.i
index 0fed36d..8daa55a 100644
--- a/include/gras/block.i
+++ b/include/gras/block.i
@@ -28,6 +28,9 @@ from PMC import *
{
%insert("python")
%{
+ def __getattr__(self, name):
+ return lambda *args: self.x(name, *args)
+
def post_output_msg(self, which_output, value):
if not isinstance(value, PMCC): value = PMC_M(value)
self._post_output_msg(which_output, value)
diff --git a/include/gras/hier_block.i b/include/gras/hier_block.i
index e3f8182..f89252e 100644
--- a/include/gras/hier_block.i
+++ b/include/gras/hier_block.i
@@ -12,4 +12,19 @@
%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*/
diff --git a/python/gras/CMakeLists.txt b/python/gras/CMakeLists.txt
index 7d5b9bd..de6175e 100644
--- a/python/gras/CMakeLists.txt
+++ b/python/gras/CMakeLists.txt
@@ -79,7 +79,7 @@ endforeach(gras_swig_module)
########################################################################
# install other python files
########################################################################
-INSTALL(
+GR_PYTHON_INSTALL(
FILES __init__.py GRAS_Utils.py
DESTINATION ${GR_PYTHON_DIR}/gras
COMPONENT ${GRAS_COMP_PYTHON}