summaryrefslogtreecommitdiff
path: root/src/if_py_both.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r--src/if_py_both.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h
index c8a7fca7f..0909981c2 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -71,6 +71,31 @@ static struct PyMethodDef OutputMethods[] = {
/* Output buffer management
*/
+ static int
+OutputSetattr(PyObject *self, char *name, PyObject *val)
+{
+ if (val == NULL)
+ {
+ PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes"));
+ return -1;
+ }
+
+ if (strcmp(name, "softspace") == 0)
+ {
+ if (!PyInt_Check(val))
+ {
+ PyErr_SetString(PyExc_TypeError, _("softspace must be an integer"));
+ return -1;
+ }
+
+ ((OutputObject *)(self))->softspace = PyInt_AsLong(val);
+ return 0;
+ }
+
+ PyErr_SetString(PyExc_AttributeError, _("invalid attribute"));
+ return -1;
+}
+
static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{