summaryrefslogtreecommitdiff
path: root/python/gras
diff options
context:
space:
mode:
authorJosh Blum2013-07-07 00:25:35 -0700
committerJosh Blum2013-07-07 00:25:35 -0700
commita8f263d94f8eb772a3a334aa5bb08c6e30b996ec (patch)
treebb9baa13d27d7d0150a6ee6c52add5288b502a0d /python/gras
parent2001959902f85723c289e3f942ec2e49954a04bc (diff)
downloadsandhi-a8f263d94f8eb772a3a334aa5bb08c6e30b996ec.tar.gz
sandhi-a8f263d94f8eb772a3a334aa5bb08c6e30b996ec.tar.bz2
sandhi-a8f263d94f8eb772a3a334aa5bb08c6e30b996ec.zip
gras: restore property access w/ json
Diffstat (limited to 'python/gras')
-rw-r--r--python/gras/GRAS_PyBlock.i13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/gras/GRAS_PyBlock.i b/python/gras/GRAS_PyBlock.i
index ff91a6f..80fc2bb 100644
--- a/python/gras/GRAS_PyBlock.i
+++ b/python/gras/GRAS_PyBlock.i
@@ -170,6 +170,18 @@ struct BlockPython : Block
}
virtual PMCC _Py_handle_call_ts(const std::string &key, const PMCC &args) = 0;
+
+ //dummy registration so the C++ knows at least the key names
+ void dummy_register_call(const std::string &key)
+ {
+ this->register_call(key, &BlockPython::__my_dummy);
+ }
+
+ //dummy call that should not really be called!
+ void __my_dummy(void)
+ {
+ throw std::runtime_error("BlockPython dummy method called -- should not happen!");
+ }
};
}
@@ -281,5 +293,6 @@ class PyBlock(BlockPython):
return PMC_M(pyret)
def register_call(self, key, call):
+ self.dummy_register_call(key) #c++ knows key name
self.__call_registry[key] = call
%}