Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > bff8b61edd457cd85078c16c0fd5033b > files > 24

gnome-python-gnomevfs-2.28.1-13.mga7.armv7hl.rpm

This a Gnome VFS module written in python that lets you browse python modules and objects.

How to test:
------------
 cp pyfs.conf ~/.gnome2/vfs/modules/
 export PYTHONPATH=$(pwd):$PYTHONPATH
 mkdir /tmp/testing
 export TMPDIR=/tmp/testing
 nautilus --no-desktop pyfs:///

 You will be presented with a list of modules and you can navigate
modules/objects.  Notice that only currently imported modules appear
initially, but if you hit Ctr-L you can force browsing of particular
modules by entering pyfs:///<module> as URL.  For example,
pyfs:///gtk/gdk will let you browse the module gtk.gdk.

How does GnomeVFS decide to use your module:
--------------------------------------------

Suppose you want to register some code to handle 'pyfs://'.  You put
"pyfs: pythonmethod" in a gnome-vfs configuration file[1].  Therefore,
when a pyfs:// URI is requested, gnome-vfs loads libpythonmethod.so,
which receives the 'pyfs' method name and then tries to import the
python module 'pyfs'.  The standard python path, plus
$(libdir)/gnome-vfs-2.0/modules, is searched for the module.  In this
module, it looks for a class called 'pyfs_method'.  It then creates a
new instance of this class, and tries to get the vfs_xxxx methods,
which are then used to implement the VFS operations.

Caveat: currently the class has to be an old-style class, so don't
subclass object.

[1] As you are asked to do in the "How to test" section; but notice
that to install it system-wide you have to copy the file to
/etc/gnome-vfs-2.0/modules/ instead of ~/.gnome2/vfs/modules/.