summaryrefslogtreecommitdiffstats
path: root/gio
diff options
context:
space:
mode:
Diffstat (limited to 'gio')
-rw-r--r--gio/gfile.override97
-rw-r--r--gio/gio.defs20
2 files changed, 115 insertions, 2 deletions
diff --git a/gio/gfile.override b/gio/gfile.override
index fb8d41c..19d8681 100644
--- a/gio/gfile.override
+++ b/gio/gfile.override
@@ -869,11 +869,104 @@ _wrap_g_file_create_async(PyGObject *self, PyObject *args, PyObject *kwargs)
Py_INCREF(Py_None);
return Py_None;
}
+%%
+override g_file_replace_async kwargs
+static PyObject *
+_wrap_g_file_replace_async(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "callback", "etag", "make_backup", "flags",
+ "io_priority", "cancellable", "user_data", NULL };
+ GCancellable *cancellable;
+ PyGObject *pycancellable = NULL;
+ GFileCreateFlags flags = G_FILE_CREATE_NONE;
+ PyObject *py_flags = NULL;
+ int io_priority = G_PRIORITY_DEFAULT;
+ char *etag = NULL;
+ gboolean make_backup = TRUE;
+ PyObject *py_backup = Py_True;
+ PyGIONotify *notify;
+
+ notify = g_slice_new0(PyGIONotify);
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "O|zOOiOO:File.replace_async",
+ kwlist,
+ &notify->callback,
+ &etag, &py_backup,
+ &flags, &io_priority,
+ &pycancellable,
+ &notify->data))
+ {
+ g_slice_free(PyGIONotify, notify);
+ return NULL;
+ }
+
+ make_backup = PyObject_IsTrue(py_backup) ? TRUE : FALSE;
+
+ if (py_flags && pyg_flags_get_value(G_TYPE_FILE_CREATE_FLAGS,
+ py_flags, (gpointer)&flags))
+ return NULL;
+
+ if (!pygio_check_cancellable(pycancellable, &cancellable))
+ return NULL;
+
+ g_file_replace_async(G_FILE(self->obj), etag, make_backup, flags,
+ io_priority, cancellable,
+ (GAsyncReadyCallback)async_result_callback_marshal,
+ notify);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+%%
+override g_file_query_info_async kwargs
+static PyObject *
+_wrap_g_file_query_info_async(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "callback", "attributes", "flags",
+ "io_priority", "cancellable", "user_data", NULL };
+ GCancellable *cancellable;
+ PyGObject *pycancellable = NULL;
+ GFileQueryInfoFlags flags = G_FILE_QUERY_INFO_NONE;
+ PyObject *py_flags = NULL;
+ int io_priority = G_PRIORITY_DEFAULT;
+ char *attributes;
+ PyGIONotify *notify;
+
+ notify = g_slice_new0(PyGIONotify);
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "Os|OiOO:File.query_info_async",
+ kwlist,
+ &notify->callback,
+ &attributes,
+ &flags, &io_priority,
+ &pycancellable,
+ &notify->data))
+
+ {
+ g_slice_free(PyGIONotify, notify);
+ return NULL;
+ }
+
+ if (py_flags && pyg_flags_get_value(G_TYPE_FILE_CREATE_FLAGS,
+ py_flags, (gpointer)&flags))
+ return NULL;
+
+ if (!pygio_check_cancellable(pycancellable, &cancellable))
+ return NULL;
+
+ g_file_query_info_async(G_FILE(self->obj), attributes, flags,
+ io_priority, cancellable,
+ (GAsyncReadyCallback)async_result_callback_marshal,
+ notify);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
/* GFile.eject_mountable */
/* GFile.find_enclosing_mount_async */
-/* GFile.query_info_async */
-/* GFile.replace_async */
/* GFile.replace_contents_async */
/* GFile.set_attributes_async */
/* GFile.set_display_name_async */
diff --git a/gio/gio.defs b/gio/gio.defs
index d0e6f2a..0f4b904 100644
--- a/gio/gio.defs
+++ b/gio/gio.defs
@@ -1453,6 +1453,16 @@
)
(define-method replace_async
+ (docstring
+ "F.replace_async(callback [etag, [make_backup, [flags, [io_priority, [cancellable, [user_data]]]]]]) -> file replace\n"
+ "\n"
+ "Asynchronously overwrites the file, replacing the contents, possibly\n"
+ "creating a backup copy of the file first.\n"
+ "For more details, see F.replace() which is the synchronous\n"
+ "version of this call.\n"
+ "When the operation is finished, callback will be called. You can\n"
+ "then call F.replace_finish() to get the result of the operation."
+ )
(of-object "GFile")
(c-name "g_file_replace_async")
(return-type "none")
@@ -1499,6 +1509,16 @@
)
(define-method query_info_async
+ (docstring
+ "F.query_info_async(callback, attributes, [flags, [io_priority, [cancellable, [user_data]]]]) -> query attributes\n\n"
+ "Asynchronously gets the requested information about specified file.\n"
+ "The result is a GFileInfo object that contains key-value attributes\n"
+ "(such as type or size for the file).\n"
+ "For more details, see F.query_info() which is the synchronous\n"
+ "version of this call. \n"
+ "When the operation is finished, callback will be called. You can\n"
+ "then call F.query_info_finish() to get the result of the operation.\n"
+ )
(of-object "GFile")
(c-name "g_file_query_info_async")
(return-type "none")