RB.DeviceSource¶
- Implementations:
None
Methods¶
class |
|
class |
|
|
|
|
|
Virtual Methods¶
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class RB.DeviceSource¶
- Bases:
- Structure:
Sources that represent physical devices should implement this interface. It exposes the ability to eject the device, and also can be used to implement some
RB.Source
methods by using details from aGio.Volume
orGio.Mount
accessed via ‘volume’ and ‘mount’ properties on the source object. Devices that are not based on aGio.Volume
orGio.Mount
can still use the interface, but they must provide implementations of the can_eject and eject methods.- classmethod uri_is_source(source, uri)¶
- Parameters:
source (
RB.Source
) – aRB.DeviceSource
uri (
str
) – a URI to check
- Returns:
True
if uri matches source- Return type:
Returns
True
if uri matches source. This should be used to implement the uri_is_sourceRB.Source
method.
- classmethod want_uri(source, uri)¶
- Parameters:
source (
RB.Source
) – aRB.DeviceSource
uri (
str
) – a URI to consider
- Returns:
URI match strength
- Return type:
Checks whether uri identifies a path underneath the device’s mount point. Should be used to implement the
RB.Source
want_uri method.
- default_eject()¶
Default method for ejecting devices. Implementations can perform any required work before ejecting, then call this do eject the device.
- eject()¶
Ejects the device that the source represents.
- set_display_details()¶
Sets the icon and display name for a device-based source. The details come from the mount and/or volume. This should be called in the source’s constructed method.
- do_eject() virtual¶
Ejects the device that the source represents.