Re: Change in libphoto2 & gvfs?



On Tue, May 24, 2011 at 2:34 AM, Alexander Larsson <alexl redhat com> wrote:
On Thu, 2011-05-05 at 15:29 -0500, Damon Lynch wrote:
> Hi everyone,
>
> I'm have python code that accesses file systems using python's GIO
> static bindings, e.g.
>
> import gio
> ...
> children = path.enumerate_children(file_attributes)
> for child in children:
>     if
> child.get_attribute_boolean(gio.FILE_ATTRIBUTE_ACCESS_CAN_READ):
>
> etc.
>
> In 2009, this kind of code used to work. However today it seems that
> it is possible for python's GIO bindings to make a camera mount
> available, but it's impossible to access any files on it using GIO's
> own library code. Moreover, the mount doesn't show up ~/.gvfs. However
> browsing the same mount in Nautilus works without difficulties.
>
> Is this a binding problem? Or has something changed in the design of
> GVFS? Or is something broken? If it's of any relevance, this is on
> Ubuntu 11.04.

No, this should still work the same. What happens? Do you get some kind
of error from the gio operations?


Since my initial email, I have tested Fedora 15 in addition to Ubuntu 11.04, and I'm getting differing results. Unfortunately both do not work as expected from within python using gio; moreover, in contrast to Fedora,Ubuntu does not create a directory in .gvfs.

On Fedora, when running gvfsd and inserting a Canon 5D Mk II (a digital SLR), this is the output:

$ GVFS_DEBUG=1 /usr/libexec/gvfsd -r
initing 0x26f10e0
Added new job source 0x26f10e0 (GVfsBackendGphoto2)
Queued new job 0x26f2800 (GVfsJobMount)
try_mount 0x26f10e0
  host=[usb:001,007]
do_mount 0x26f10e0
  host='[usb:001,007]'
  decoded host='usb:001,007'
Parsed 'usb:001,007' into device name /dev/bus/usb/001/007
-> sysfs path /sys/devices/pci0000:00/0000:00:0b.0/usb1/1-1, subsys usb, name 1-1
  gphoto2_port='usb:001,007'
  'Universal Serial Bus' 'usb:001,007' '/usr/lib64/libgphoto2_port/0.8.0/usb'
Using ignore_prefix='/store_00010001/'
  can_write = 1
  can_delete = 1
send_reply, failed: 0
  mounted 0x26f10e0
register_mount_callback, mount_reply: 0x26eac00, error: (nil)

Ubuntu gives very similar output.

At this point, Fedora has created a directory for the camera under .gvfs, and listing files from the command line causes gvfsd to output information.
Because Ubuntu has not created a directory for the camera under .gvfs, I don't know how to browse it from the command line. It can however be browsed without difficulties in nautilus.

On both Fedora and Ubuntu, running commands from within python, such as these, do not work as expected:
>>> import gio
>>> vmonitor = gio.volume_monitor_get()
>>> vmonitor.get_mounts()
[<__main__.GDaemonMount at 0x2a837d0: Canon Digital Camera>, <__main__.GProxyMount at 0x2a83820: freedata1>]
>>> m = vmonitor.get_mounts()[0]
>>> m.get_root()
<__main__.GDaemonFile at 0x2a83870: gphoto2://[usb:001,013]/>
>>> m.get_root().get_path()
>>>

We can see the get_path() call is returning nothing. This happens all the time in Ubuntu, and in Fedora I was able to return a path until there were further serious problems that I've been unable to since replicate (currently like Ubuntu, I cannot get the path). Moreover, when running any of these commands from within python, gvfsd returns nothing. This is in contrast to the voluminous output when browsing in nautilus or in Fedora when listing files from the command line.

This is probably not the appropriate mailing list to diagnose Ubuntu specific problems, but it seems to me that Fedora is also having issues, from within python at least.

Thanks for your interest.

Damon

--
http://www.damonlynch.net


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]