After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 121629 - Wrapper for gnome-vfs async API
Wrapper for gnome-vfs async API
Status: RESOLVED FIXED
Product: gnome-python
Classification: Deprecated
Component: gnome
2.0.x
Other Linux
: Normal enhancement
: ---
Assigned To: Iñaki
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2003-09-06 18:55 UTC by Iñaki
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Trivial part of the patch (1.91 KB, patch)
2003-09-06 18:57 UTC, Iñaki
none Details | Review
Interesting part of the patch. (22.96 KB, text/plain)
2003-09-06 18:58 UTC, Iñaki
  Details
example of usage (3.08 KB, text/plain)
2003-09-06 19:03 UTC, Iñaki
  Details

Description Iñaki 2003-09-06 18:55:55 UTC
attached goes a patch adding gnome_vfs_async support to gnome-python.
The actual code goes in vfs-async-handle.c, also attached [1].

Short description (please ask for clarification if needed, comments are
welcome):
All new functionality lives under gnome.vfs.async, have a look to the
attached example to see usage of the wrapper.
Most gnome_vfs_async_* stuff is wrapped, exceptions being:
- set_file_info: Requires major gnome.vfs.FileInfo surgery.
- [open|create]_as_stream: Requires GIOChannel wrappers not yet written
AFAICS.
- async_xfer, find_directory, file_control: I'm lazy, but the current
gnome-python wrappers don't include the sync versions either. It
shouldn't be difficult in case someone desperately needs it, just ask
for it.

The api for the wrappers is straightforward, it follows the order of the
C api except for the callback parameter, which gets promoted to being
the last required arg, and the handle, which disappears. I.e.:
C: open(handle, uri, open_mode, priority, callback, data)
becomes
Python: open(uri, callback [, open_mode, priority, data])
Comment 1 Iñaki 2003-09-06 18:57:08 UTC
Created attachment 19785 [details] [review]
Trivial part of the patch
Comment 2 Iñaki 2003-09-06 18:58:44 UTC
Created attachment 19786 [details]
Interesting part of the patch.
Comment 3 Iñaki 2003-09-06 19:03:26 UTC
Created attachment 19787 [details]
example of usage
Comment 4 Gustavo Carneiro 2004-06-27 16:03:01 UTC
In pygvfs_async_create, I changed default permission from 0666 to 0644, for
obvious reasons I hope :)
I also reformatted the code a bit, in pygtk we don't use spaces around () in
function calls.  Other than that, code was comitted as is to HEAD.  Also the
example program.

Thanks!
Comment 5 Gustavo Carneiro 2004-08-29 12:48:07 UTC
I changed the API slightly.  I added bytes_requested to read/write callbacks,
which was missing.  I don't see any reason to omit such parameter, and it can be
useful sometimes.  Also updated examples/vfs/async.py updated, since that's the
only form of documentation we have so far.. :)