[pygobject] Bug 598435 - No wrapping for g_find_program_in_path ()
- From: Gian Mario Tagliaretti <gianmt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pygobject] Bug 598435 - No wrapping for g_find_program_in_path ()
- Date: Fri, 18 Dec 2009 00:21:34 +0000 (UTC)
commit 108c03b78f04b4bcfe066a6cb4d941e172bd32fe
Author: Gian Mario Tagliaretti <gianmt gnome org>
Date: Fri Dec 18 01:20:34 2009 +0100
Bug 598435 - No wrapping for g_find_program_in_path ()
glib/glibmodule.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/glib/glibmodule.c b/glib/glibmodule.c
index 74a09db..f794d5d 100644
--- a/glib/glibmodule.c
+++ b/glib/glibmodule.c
@@ -595,6 +595,24 @@ pyglib_set_prgname(PyObject *self, PyObject *arg)
return Py_None;
}
+static PyObject *
+pyglib_find_program_in_path(PyObject *unused, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "program", NULL };
+ char *program, *ret;
+ PyObject *retval;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "s:glib.find_program_in_path", kwlist,
+ &program))
+ return NULL;
+
+ ret = g_find_program_in_path(program);
+ retval = _PyUnicode_FromString(ret);
+ g_free(ret);
+ return retval;
+}
+
static PyMethodDef _glib_functions[] = {
{ "threads_init",
(PyCFunction) pyglib_threads_init, METH_NOARGS,
@@ -688,6 +706,8 @@ static PyMethodDef _glib_functions[] = {
(PyCFunction)pyglib_get_user_special_dir, METH_VARARGS|METH_KEYWORDS },
{ "markup_escape_text",
(PyCFunction)pyglib_markup_escape_text, METH_VARARGS|METH_KEYWORDS },
+ { "find_program_in_path",
+ (PyCFunction)pyglib_find_program_in_path, METH_VARARGS|METH_KEYWORDS },
{ NULL, NULL, 0 }
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]