summaryrefslogtreecommitdiffstats
path: root/gio
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@src.gnome.org>2008-08-01 22:42:37 +0000
committerGian Mario Tagliaretti <gianmt@src.gnome.org>2008-08-01 22:42:37 +0000
commit9e22741a4683e4184ffcdaf7382b0ba045f4a3be (patch)
treec00e01731781b6b3813d320b1dc89efaf84e6351 /gio
parentbd788d5972dc5d1896820740061bbc9250d80682 (diff)
downloadpygobject-9e22741a4683e4184ffcdaf7382b0ba045f4a3be.tar.gz
pygobject-9e22741a4683e4184ffcdaf7382b0ba045f4a3be.tar.xz
pygobject-9e22741a4683e4184ffcdaf7382b0ba045f4a3be.zip
Wrap GFile.query_writable_namespaces with docs and test
svn path=/trunk/; revision=909
Diffstat (limited to 'gio')
-rw-r--r--gio/gfile.override46
-rw-r--r--gio/gio.defs10
2 files changed, 55 insertions, 1 deletions
diff --git a/gio/gfile.override b/gio/gfile.override
index f95197e..d9c6d54 100644
--- a/gio/gfile.override
+++ b/gio/gfile.override
@@ -737,7 +737,52 @@ _wrap_g_file_query_settable_attributes(PyGObject *self,
return Py_None;
}
}
+%%
+override g_file_query_writable_namespaces kwargs
+static PyObject *
+_wrap_g_file_query_writable_namespaces(PyGObject *self,
+ PyObject *args,
+ PyObject *kwargs)
+{
+ static char *kwlist[] = { "cancellable", NULL };
+ PyGObject *pycancellable = NULL;
+ GCancellable *cancellable = NULL;
+ GFileAttributeInfoList *ret;
+ GError *error = NULL;
+ gint i, n_infos;
+ GFileAttributeInfo *infos;
+ PyObject *py_ret;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "|O:GFile.query_writable_namespaces",
+ kwlist, &pycancellable))
+ return NULL;
+ if (!pygio_check_cancellable(pycancellable, &cancellable))
+ return NULL;
+
+ ret = g_file_query_writable_namespaces(G_FILE(self->obj),
+ (GCancellable *) cancellable,
+ &error);
+ if (pyg_error_check(&error))
+ return NULL;
+
+ n_infos = ret->n_infos;
+ infos = ret->infos;
+
+ if (n_infos > 0) {
+ py_ret = PyList_New(n_infos);
+ for (i = 0; i < n_infos; i++) {
+ PyList_SetItem(py_ret, i, pyg_file_attribute_info_new(&infos[i]));
+ }
+ g_file_attribute_info_list_unref(ret);
+ return py_ret;
+
+ } else {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+}
/* GFile.append_to_async */
/* GFile.create_async */
/* GFile.eject_mountable */
@@ -749,7 +794,6 @@ _wrap_g_file_query_settable_attributes(PyGObject *self,
/* GFile.set_display_name_async */
/* GFile.load_partial_contents_async: No ArgType for GFileReadMoreCallback */
/* GFile.move: No ArgType for GFileProgressCallback */
-/* GFile.query_writable_namespaces: No ArgType for GFileAttributeInfoList* */
/* GFile.set_attributes_finish: No ArgType for GFileInfo** */
/* GFile.load_partial_contents_finish: No ArgType for char** */
/* GFile.replace_contents: No ArgType for char** */
diff --git a/gio/gio.defs b/gio/gio.defs
index dbd0f63..3ad3518 100644
--- a/gio/gio.defs
+++ b/gio/gio.defs
@@ -1818,6 +1818,16 @@
)
(define-method query_writable_namespaces
+ (docstring
+ "F.query_writable_namespaces([cancellable]) -> list\n\n"
+ "Obtain the list of attribute namespaces where new attributes can\n"
+ "be created by a user. An example of this is extended attributes\n"
+ "(in the "xattr" namespace).\n"
+ "If cancellable is not None, then the operation can be cancelled\n"
+ "by triggering the cancellable object from another thread. If the\n"
+ "operation was cancelled, the error gio.IO_ERROR_CANCELLED\n"
+ "will be returned."
+ )
(of-object "GFile")
(c-name "g_file_query_writable_namespaces")
(return-type "GFileAttributeInfoList*")