Commit 12d3080b authored by Nalin Dahyabhai's avatar Nalin Dahyabhai

give length parameters for feed() and feed_child() default values of -1

* python/vte.defs: give length parameters for feed() and feed_child() default
	values of -1 (bug #118711).
* python/vte.override: use the length parameter if it's supplied to the feed()
	and feed_child() methods.
parent 4fda439d
2003-08-11 nalin
* python/vte.defs: give length parameters for feed() and feed_child()
default values of -1 (bug #118711).
* python/vte.override: use the length parameter if it's supplied to the
feed() and feed_child() methods.
2003-08-11 nalin
* python/vte.override: add overrides for feed() and feed_child()
methods which use the length of the string as given in C, to hopefully
......
......@@ -61,7 +61,7 @@
(return-type "none")
(parameters
'("const-char*" "data")
'("glong" "length")
'("glong" "length" (default "-1"))
)
)
......@@ -71,7 +71,7 @@
(return-type "none")
(parameters
'("const-char*" "data")
'("glong" "length")
'("glong" "length" (default "-1"))
)
)
......
......@@ -25,6 +25,16 @@ _wrap_vte_terminal_feed(PyGObject *self, PyObject *args, PyObject *kwargs)
kwlist, &data, &length, &length_obj)) {
return NULL;
}
if ((length_obj != NULL) && PyNumber_Check(length_obj)) {
PyObject *intobj;
intobj = PyNumber_Int(length_obj);
if (intobj) {
if (PyInt_AsLong(intobj) != -1) {
length = PyInt_AsLong(intobj);
}
Py_DECREF(intobj);
}
}
vte_terminal_feed(VTE_TERMINAL(self->obj), data, length);
Py_INCREF(Py_None);
return Py_None;
......@@ -44,6 +54,16 @@ _wrap_vte_terminal_feed_child(PyGObject *self, PyObject *args, PyObject *kwargs)
kwlist, &data, &length, &length_obj)) {
return NULL;
}
if ((length_obj != NULL) && PyNumber_Check(length_obj)) {
PyObject *intobj;
intobj = PyNumber_Int(length_obj);
if (intobj) {
if (PyInt_AsLong(intobj) != -1) {
length = PyInt_AsLong(intobj);
}
Py_DECREF(intobj);
}
}
vte_terminal_feed_child(VTE_TERMINAL(self->obj), data, length);
Py_INCREF(Py_None);
return Py_None;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment