summaryrefslogtreecommitdiff
path: root/python/gras
diff options
context:
space:
mode:
Diffstat (limited to 'python/gras')
-rw-r--r--python/gras/GRAS_SBuffer.i7
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,
)
%}