Comment 3 for bug 708502

Revision history for this message
Martin Pitt (pitti) wrote :

No, python-gudev was a temporary hack. The current method to do Python bindings is via gobject-introspection (http://live.gnome.org
/GObjectIntrospection), like this:

sudo apt-get install gir1.2-gudev-1.0

python
>>> from gi.repository import GUdev
>>> client = GUdev.Client.new(['usb'])
>>> devs = client.query_by_subsystem('block')
>>> devs[0].get_name()
'sda'
>>> devs[0].get_property('ID_MODEL')
'SAMSUNG_MMCRE28G8MXP-0VBL1'

I. e. it uses the very same API as the C one, so you can use the existing documentation (via devhelp, or http://www.kernel.org/pub/linux/utils/kernel/hotplug/gudev/).