[farsight2/master] Add python bindings for fs_session_list_transmitters

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:26:02 PST 2008


---
 python/pyfarsight.defs     |    7 +++++++
 python/pyfarsight.override |   28 ++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/python/pyfarsight.defs b/python/pyfarsight.defs
index bbfe403..433690f 100644
--- a/python/pyfarsight.defs
+++ b/python/pyfarsight.defs
@@ -422,6 +422,13 @@
   )
 )
 
+(define-method list_transmitters
+  (of-object "FsSession")
+  (unblock-threads t)
+  (c-name "fs_session_list_transmitters")
+  (return-type "gchar**")
+)
+
 (define-method emit_error
   (of-object "FsSession")
   (unblock-threads t)
diff --git a/python/pyfarsight.override b/python/pyfarsight.override
index faf35bb..2efdb7f 100644
--- a/python/pyfarsight.override
+++ b/python/pyfarsight.override
@@ -808,3 +808,31 @@ _wrap_fs_codec_list_are_equal(PyGObject *self, PyObject *args, PyObject *kwargs)
 
   return PyBool_FromLong (ret);
 }
+%%
+override fs_session_list_transmitters noargs
+static PyObject *
+_wrap_fs_session_list_transmitters (PyGObject *self)
+{
+  gchar **strv = NULL;
+  gint i;
+  PyObject *tuple;
+
+  Py_BEGIN_ALLOW_THREADS
+  strv = fs_session_list_transmitters (FS_SESSION(self->obj));
+  Py_END_ALLOW_THREADS
+
+  if (!strv)
+  {
+    Py_INCREF(Py_None);
+    return Py_None;
+  }
+
+  tuple = PyTuple_New (g_strv_length (strv));
+
+  for (i=0; strv[i]; i++)
+    PyTuple_SET_ITEM (tuple, i, PyString_FromString(strv[i]));
+
+  g_strfreev (strv);
+
+  return tuple;
+}
-- 
1.5.6.5




More information about the farsight-commits mailing list