From 7cfebe2bd52a2cfc1e8b778968cec7ba43457879 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 25 Nov 2012 02:32:48 -0800 Subject: address the readonly marker for sbuffer in python only gets set when its a PMCC... --- python/gras/GRAS_SBuffer.i | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'python/gras') diff --git a/python/gras/GRAS_SBuffer.i b/python/gras/GRAS_SBuffer.i index 712949b..8b57863 100644 --- a/python/gras/GRAS_SBuffer.i +++ b/python/gras/GRAS_SBuffer.i @@ -14,6 +14,11 @@ DECL_PMC_SWIG_TYPE(gras::SBuffer, swig_sbuffer) from PMC import * +def pmc_to_sbuffer(p): + s = pmc_to_swig_sbuffer(p) + setattr(s, 'readonly', not isinstance(p, PMC)) + return s + RegisterPy2PMC( is_py = lambda x: isinstance(x, SBuffer), py2pmc = swig_sbuffer_to_pmc, @@ -21,7 +26,7 @@ RegisterPy2PMC( RegisterPMC2Py( is_pmc = pmc_is_swig_sbuffer, - pmc2py = pmc_to_swig_sbuffer, + pmc2py = pmc_to_sbuffer, ) %} -- cgit