knocte@linux-f6wh:~/Documentos/banshee> python
Python 2.6.2 (r262:71600, Jun 17 2010, 13:37:18) 
[GCC 4.4.1 [gcc-4_4-branch revision 150839]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbus;
>>> bus = dbus.SystemBus()
>>> proxy = bus.get_object("org.freedesktop.DeviceKit.Disks","/org/freedesktop/DeviceKit/Disks")
>>> iface = dbus.Interface (proxy, "org.freedesktop.DeviceKit.Disks")
>>> print iface.EnumerateDevices()
dbus.Array([dbus.ObjectPath('/org/freedesktop/DeviceKit/Disks/devices/sda5'), dbus.ObjectPath('/org/freedesktop/DeviceKit/Disks/devices/sda6'), dbus.ObjectPath('/org/freedesktop/DeviceKit/Disks/devices/sda7'), dbus.ObjectPath('/org/freedesktop/DeviceKit/Disks/devices/sdb'), dbus.ObjectPath('/org/freedesktop/DeviceKit/Disks/devices/sda'), dbus.ObjectPath('/org/freedesktop/DeviceKit/Disks/devices/sr0'), dbus.ObjectPath('/org/freedesktop/DeviceKit/Disks/devices/sda1'), dbus.ObjectPath('/org/freedesktop/DeviceKit/Disks/devices/sdb1'), dbus.ObjectPath('/org/freedesktop/DeviceKit/Disks/devices/sdb2')], signature=dbus.Signature('o'))
>>> path = iface.FindDeviceByDeviceFile("/dev/sdb2")
>>> device = bus.get_object("org.freedesktop.DeviceKit.Disks", path) 
>>> print device.Introspect()
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
      <arg name="data" direction="out" type="s"/>
    </method>
  </interface>
  <interface name="org.freedesktop.DBus.Properties">
    <method name="Get">
      <arg name="interface" direction="in" type="s"/>
      <arg name="propname" direction="in" type="s"/>
      <arg name="value" direction="out" type="v"/>
    </method>
    <method name="Set">
      <arg name="interface" direction="in" type="s"/>
      <arg name="propname" direction="in" type="s"/>
      <arg name="value" direction="in" type="v"/>
    </method>
    <method name="GetAll">
      <arg name="interface" direction="in" type="s"/>
      <arg name="props" direction="out" type="a{sv}"/>
    </method>
  </interface>
  <interface name="org.freedesktop.DeviceKit.Disks.Device">
    <method name="DriveAtaSmartInitiateSelftest">
      <arg name="test" type="s" direction="in"/>
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="DriveAtaSmartRefreshData">
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="DriveUnsetSpindownTimeout">
      <arg name="cookie" type="s" direction="in"/>
    </method>
    <method name="DriveSetSpindownTimeout">
      <arg name="timeout_seconds" type="i" direction="in"/>
      <arg name="options" type="as" direction="in"/>
      <arg name="cookie" type="s" direction="out"/>
    </method>
    <method name="DriveDetach">
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="DriveEject">
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="DrivePollMedia">
    </method>
    <method name="DriveUninhibitPolling">
      <arg name="cookie" type="s" direction="in"/>
    </method>
    <method name="DriveInhibitPolling">
      <arg name="options" type="as" direction="in"/>
      <arg name="cookie" type="s" direction="out"/>
    </method>
    <method name="LinuxMdCheck">
      <arg name="options" type="as" direction="in"/>
      <arg name="number_of_errors" type="t" direction="out"/>
    </method>
    <method name="LinuxMdStop">
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="LinuxMdRemoveComponent">
      <arg name="component" type="o" direction="in"/>
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="LinuxMdAddComponent">
      <arg name="component" type="o" direction="in"/>
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="LuksChangePassphrase">
      <arg name="current_passphrase" type="s" direction="in"/>
      <arg name="new_passphrase" type="s" direction="in"/>
    </method>
    <method name="LuksLock">
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="LuksUnlock">
      <arg name="passphrase" type="s" direction="in"/>
      <arg name="options" type="as" direction="in"/>
      <arg name="cleartext_device" type="o" direction="out"/>
    </method>
    <method name="FilesystemListOpenFiles">
      <arg name="processes" type="a(uus)" direction="out"/>
    </method>
    <method name="FilesystemCheck">
      <arg name="options" type="as" direction="in"/>
      <arg name="is_clean" type="b" direction="out"/>
    </method>
    <method name="FilesystemUnmount">
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="FilesystemMount">
      <arg name="filesystem_type" type="s" direction="in"/>
      <arg name="options" type="as" direction="in"/>
      <arg name="mount_path" type="s" direction="out"/>
    </method>
    <method name="FilesystemSetLabel">
      <arg name="new_label" type="s" direction="in"/>
    </method>
    <method name="FilesystemCreate">
      <arg name="fstype" type="s" direction="in"/>
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="PartitionModify">
      <arg name="type" type="s" direction="in"/>
      <arg name="label" type="s" direction="in"/>
      <arg name="flags" type="as" direction="in"/>
    </method>
    <method name="PartitionCreate">
      <arg name="offset" type="t" direction="in"/>
      <arg name="size" type="t" direction="in"/>
      <arg name="type" type="s" direction="in"/>
      <arg name="label" type="s" direction="in"/>
      <arg name="flags" type="as" direction="in"/>
      <arg name="options" type="as" direction="in"/>
      <arg name="fstype" type="s" direction="in"/>
      <arg name="fsoptions" type="as" direction="in"/>
      <arg name="created_device" type="o" direction="out"/>
    </method>
    <method name="PartitionDelete">
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="PartitionTableCreate">
      <arg name="scheme" type="s" direction="in"/>
      <arg name="options" type="as" direction="in"/>
    </method>
    <method name="JobCancel">
    </method>
    <signal name="JobChanged">
      <arg type="b"/>
      <arg type="s"/>
      <arg type="u"/>
      <arg type="b"/>
      <arg type="d"/>
    </signal>
    <signal name="Changed">
    </signal>
    <property name="LinuxMdSyncSpeed" type="t" access="read"/>
    <property name="LinuxMdSyncPercentage" type="d" access="read"/>
    <property name="LinuxMdSyncAction" type="s" access="read"/>
    <property name="LinuxMdIsDegraded" type="b" access="read"/>
    <property name="LinuxMdSlaves" type="ao" access="read"/>
    <property name="LinuxMdVersion" type="s" access="read"/>
    <property name="LinuxMdNumRaidDevices" type="i" access="read"/>
    <property name="LinuxMdName" type="s" access="read"/>
    <property name="LinuxMdHomeHost" type="s" access="read"/>
    <property name="LinuxMdUuid" type="s" access="read"/>
    <property name="LinuxMdLevel" type="s" access="read"/>
    <property name="LinuxMdState" type="s" access="read"/>
    <property name="LinuxMdComponentState" type="as" access="read"/>
    <property name="LinuxMdComponentHolder" type="o" access="read"/>
    <property name="LinuxMdComponentVersion" type="s" access="read"/>
    <property name="LinuxMdComponentHomeHost" type="s" access="read"/>
    <property name="LinuxMdComponentName" type="s" access="read"/>
    <property name="LinuxMdComponentUuid" type="s" access="read"/>
    <property name="LinuxMdComponentNumRaidDevices" type="i" access="read"/>
    <property name="LinuxMdComponentLevel" type="s" access="read"/>
    <property name="DriveAtaSmartBlob" type="ay" access="read"/>
    <property name="DriveAtaSmartStatus" type="s" access="read"/>
    <property name="DriveAtaSmartTimeCollected" type="t" access="read"/>
    <property name="DriveAtaSmartIsAvailable" type="b" access="read"/>
    <property name="OpticalDiscNumSessions" type="u" access="read"/>
    <property name="OpticalDiscNumAudioTracks" type="u" access="read"/>
    <property name="OpticalDiscNumTracks" type="u" access="read"/>
    <property name="OpticalDiscIsClosed" type="b" access="read"/>
    <property name="OpticalDiscIsAppendable" type="b" access="read"/>
    <property name="OpticalDiscIsBlank" type="b" access="read"/>
    <property name="DriveIsRotational" type="b" access="read"/>
    <property name="DriveCanSpindown" type="b" access="read"/>
    <property name="DriveCanDetach" type="b" access="read"/>
    <property name="DriveIsMediaEjectable" type="b" access="read"/>
    <property name="DriveMedia" type="s" access="read"/>
    <property name="DriveMediaCompatibility" type="as" access="read"/>
    <property name="DriveConnectionSpeed" type="t" access="read"/>
    <property name="DriveConnectionInterface" type="s" access="read"/>
    <property name="DriveSerial" type="s" access="read"/>
    <property name="DriveRevision" type="s" access="read"/>
    <property name="DriveModel" type="s" access="read"/>
    <property name="DriveVendor" type="s" access="read"/>
    <property name="PartitionTableCount" type="i" access="read"/>
    <property name="PartitionTableScheme" type="s" access="read"/>
    <property name="PartitionSize" type="t" access="read"/>
    <property name="PartitionOffset" type="t" access="read"/>
    <property name="PartitionNumber" type="i" access="read"/>
    <property name="PartitionFlags" type="as" access="read"/>
    <property name="PartitionUuid" type="s" access="read"/>
    <property name="PartitionLabel" type="s" access="read"/>
    <property name="PartitionType" type="s" access="read"/>
    <property name="PartitionScheme" type="s" access="read"/>
    <property name="PartitionSlave" type="o" access="read"/>
    <property name="LuksCleartextUnlockedByUid" type="u" access="read"/>
    <property name="LuksCleartextSlave" type="o" access="read"/>
    <property name="LuksHolder" type="o" access="read"/>
    <property name="IdLabel" type="s" access="read"/>
    <property name="IdUuid" type="s" access="read"/>
    <property name="IdVersion" type="s" access="read"/>
    <property name="IdType" type="s" access="read"/>
    <property name="IdUsage" type="s" access="read"/>
    <property name="JobPercentage" type="d" access="read"/>
    <property name="JobIsCancellable" type="b" access="read"/>
    <property name="JobInitiatedByUid" type="u" access="read"/>
    <property name="JobId" type="s" access="read"/>
    <property name="JobInProgress" type="b" access="read"/>
    <property name="DevicePresentationIconName" type="s" access="read"/>
    <property name="DevicePresentationName" type="s" access="read"/>
    <property name="DevicePresentationNopolicy" type="b" access="read"/>
    <property name="DevicePresentationHide" type="b" access="read"/>
    <property name="DeviceBlockSize" type="t" access="read"/>
    <property name="DeviceSize" type="t" access="read"/>
    <property name="DeviceIsLinuxMd" type="b" access="read"/>
    <property name="DeviceIsLinuxMdComponent" type="b" access="read"/>
    <property name="DeviceIsLuksCleartext" type="b" access="read"/>
    <property name="DeviceIsLuks" type="b" access="read"/>
    <property name="DeviceMountedByUid" type="u" access="read"/>
    <property name="DeviceMountPaths" type="as" access="read"/>
    <property name="DeviceIsMounted" type="b" access="read"/>
    <property name="DeviceIsOpticalDisc" type="b" access="read"/>
    <property name="DeviceIsDrive" type="b" access="read"/>
    <property name="DeviceIsReadOnly" type="b" access="read"/>
    <property name="DeviceIsMediaChangeDetectionInhibited" type="b" access="read"/>
    <property name="DeviceIsMediaChangeDetectionInhibitable" type="b" access="read"/>
    <property name="DeviceIsMediaChangeDetectionPolling" type="b" access="read"/>
    <property name="DeviceIsMediaChangeDetected" type="b" access="read"/>
    <property name="DeviceIsMediaAvailable" type="b" access="read"/>
    <property name="DeviceIsRemovable" type="b" access="read"/>
    <property name="DeviceIsPartitionTable" type="b" access="read"/>
    <property name="DeviceIsPartition" type="b" access="read"/>
    <property name="DeviceIsSystemInternal" type="b" access="read"/>
    <property name="DeviceFileByPath" type="as" access="read"/>
    <property name="DeviceFileById" type="as" access="read"/>
    <property name="DeviceFile" type="s" access="read"/>
    <property name="DeviceMinor" type="x" access="read"/>
    <property name="DeviceMajor" type="x" access="read"/>
    <property name="DeviceMediaDetectionTime" type="t" access="read"/>
    <property name="DeviceDetectionTime" type="t" access="read"/>
    <property name="NativePath" type="s" access="read"/>
  </interface>
</node>

>>> 
>>> device_prop = dbus.Interface(device, "org.freedesktop.DBus.Properties")
>>> print device_prop.Get("org.freedesktop.DeviceKit.Disks.Device", "device-mount-paths")
dbus.Array([dbus.String(u'/media/KNOCPOD')], signature=dbus.Signature('s'), variant_level=1)
>>> print device_prop.Get("org.freedesktop.DeviceKit.Disks.Device", "device-is-read-only")
0

