diff options
author | Josh Blum | 2012-11-25 02:32:48 -0800 |
---|---|---|
committer | Josh Blum | 2012-11-25 02:32:48 -0800 |
commit | 7cfebe2bd52a2cfc1e8b778968cec7ba43457879 (patch) | |
tree | 9ef578b24ef7ccbc948393a02454283e406d6905 /python/gras | |
parent | f31ffe88efd4ef2e6f262fbda39dba44d3bb0925 (diff) | |
download | sandhi-7cfebe2bd52a2cfc1e8b778968cec7ba43457879.tar.gz sandhi-7cfebe2bd52a2cfc1e8b778968cec7ba43457879.tar.bz2 sandhi-7cfebe2bd52a2cfc1e8b778968cec7ba43457879.zip |
address the readonly marker for sbuffer in python
only gets set when its a PMCC...
Diffstat (limited to 'python/gras')
-rw-r--r-- | python/gras/GRAS_SBuffer.i | 7 |
1 files changed, 6 insertions, 1 deletions
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, ) %} |