pybank r70 - in trunk: . bank
- From: walters svn gnome org
- To: svn-commits-list gnome org
- Subject: pybank r70 - in trunk: . bank
- Date: Sat, 30 Aug 2008 21:40:56 +0000 (UTC)
Author: walters
Date: Sat Aug 30 21:40:56 2008
New Revision: 70
URL: http://svn.gnome.org/viewvc/pybank?rev=70&view=rev
Log:
2008-08-30 Colin Walters <walters verbum org>
* bank/bank-repository.c: Update to new g-i API.
Modified:
trunk/ChangeLog
trunk/bank/bank-repository.c
Modified: trunk/bank/bank-repository.c
==============================================================================
--- trunk/bank/bank-repository.c (original)
+++ trunk/bank/bank-repository.c Sat Aug 30 21:40:56 2008
@@ -50,19 +50,25 @@
PyObject *args,
PyObject *kwargs)
{
- static char *kwlist[] = { "namespace", NULL };
- gchar *filename;
- const gchar *namespace;
+ static char *kwlist[] = { "namespace", "lazy", NULL };
+ gchar *namespace;
+ PyObject *lazy_obj = NULL;
+ int flags = 0;
+ gboolean ret;
+ PyObject *pyret;
GError *error = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "s:GIRepository.require",
- kwlist, &filename))
+ "s|O:GIRepository.require",
+ kwlist, &namespace, &lazy_obj))
return NULL;
- namespace = g_irepository_require(self->repo, filename, &error);
+ if (lazy_obj != NULL && PyObject_IsTrue(lazy_obj))
+ flags |= G_IREPOSITORY_LOAD_FLAG_LAZY;
+
+ ret = g_irepository_require(self->repo, namespace, flags, &error);
- if (error) {
+ if (!ret) {
#if 0
g_print ("ERROR: %s (FIXME: raise GError exception)\n",
error->message);
@@ -71,7 +77,9 @@
Py_INCREF(Py_None);
return Py_None;
}
- return PyString_FromString(namespace);
+ pyret = PyBool_FromLong(ret);
+ Py_INCREF(pyret);
+ return pyret;
}
static PyObject *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]