我在python中通过dbus使用Udisks来卸载USB设备(本例中为Kindle),但是我想将弹出信号发送给它,因为这会将Kindle从USB模式退回到其常用界面。
Udisk不会让我DriveEject,因为它不是一个实际的驱动器,我收集这是一个功能。给出的错误是:
dbus.exceptions.DBusException: org.freedesktop.UDisks.Error.Failed: Device is not a driveUdisks documentation提到可弹出属性:
ID_DRIVE_EJECTABLE
Whether the media in the drive is
physically ejectable. Only set this to
1 (or 0) if the drive truly uses (or
doesn't) ejectable media. In
particular, it is not necessary to set
this for e.g. iPod or Kindle devices
where it is necessary to send a
command via eject(1) since the desktop
user session will offer this option
for removable devices regardless of
whether they are ejectable. If this
property is not set, a heuristic will
be used to determine if the media is
ejectable (drives using optical, Zip
or Jaz media are considered
ejectable).
但并未解释如何从桌面用户会话执行此操作。
(Nautilus可以让我从桌面shell弹出,'eject'shell命令将会卸载,但不会在没有sudo的情况下将弹出信号发送到设备)
是否有任何合法的方式来与Udisk进行这项工作,如果不是,Nautlius如何去做呢?