UDisks.Drive

g GObject.GInterface GObject.GInterface UDisks.Drive UDisks.Drive GObject.GInterface->UDisks.Drive

Implementations:

UDisks.DriveProxy, UDisks.DriveSkeleton

Methods

class

interface_info ()

class

override_properties (klass, property_id_begin)

call_eject (arg_options, cancellable, callback, *user_data)

call_eject_finish (res)

call_eject_sync (arg_options, cancellable)

call_power_off (arg_options, cancellable, callback, *user_data)

call_power_off_finish (res)

call_power_off_sync (arg_options, cancellable)

call_set_configuration (arg_value, arg_options, cancellable, callback, *user_data)

call_set_configuration_finish (res)

call_set_configuration_sync (arg_value, arg_options, cancellable)

complete_eject (invocation)

complete_power_off (invocation)

complete_set_configuration (invocation)

Virtual Methods

do_handle_eject (invocation, arg_options)

do_handle_power_off (invocation, arg_options)

do_handle_set_configuration (invocation, arg_value, arg_options)

Properties

Name

Type

Flags

Short Description

can-power-off

bool

r/w

CanPowerOff

configuration

GLib.Variant

r/w

Configuration

connection-bus

str

r/w

ConnectionBus

ejectable

bool

r/w

Ejectable

id

str

r/w

Id

media

str

r/w

Media

media-available

bool

r/w

MediaAvailable

media-change-detected

bool

r/w

MediaChangeDetected

media-compatibility

[str]

r/w

MediaCompatibility

media-removable

bool

r/w

MediaRemovable

model

str

r/w

Model

optical

bool

r/w

Optical

optical-blank

bool

r/w

OpticalBlank

optical-num-audio-tracks

int

r/w

OpticalNumAudioTracks

optical-num-data-tracks

int

r/w

OpticalNumDataTracks

optical-num-sessions

int

r/w

OpticalNumSessions

optical-num-tracks

int

r/w

OpticalNumTracks

removable

bool

r/w

Removable

revision

str

r/w

Revision

rotation-rate

int

r/w

RotationRate

seat

str

r/w

Seat

serial

str

r/w

Serial

sibling-id

str

r/w

SiblingId

size

int

r/w

Size

sort-key

str

r/w

SortKey

time-detected

int

r/w

TimeDetected

time-media-detected

int

r/w

TimeMediaDetected

vendor

str

r/w

Vendor

wwn

str

r/w

WWN

Signals

Name

Short Description

handle-eject

Signal emitted when a remote caller is invoking the Eject() D-Bus method.

handle-power-off

Signal emitted when a remote caller is invoking the PowerOff() D-Bus method.

handle-set-configuration

Signal emitted when a remote caller is invoking the SetConfiguration() D-Bus method.

Fields

None

Class Details

class UDisks.Drive
Bases:

GObject.GInterface

Structure:

UDisks.DriveIface

Abstract interface type for the D-Bus interface org.freedesktop.UDisks2.Drive.

classmethod interface_info()
Returns:

A Gio.DBusInterfaceInfo. Do not free.

Return type:

Gio.DBusInterfaceInfo

Gets a machine-readable description of the org.freedesktop.UDisks2.Drive D-Bus interface.

classmethod override_properties(klass, property_id_begin)
Parameters:
Returns:

The last property id.

Return type:

int

Overrides all GObject.Object properties in the UDisks.Drive interface for a concrete class. The properties are overridden in the order they are defined.

call_eject(arg_options, cancellable, callback, *user_data)
Parameters:

Asynchronously invokes the Eject() D-Bus method on self. When the operation is finished, callback will be invoked in the thread-default main loop of the thread you are calling this method from (see GLib.MainContext.push_thread_default()). You can then call UDisks.Drive.call_eject_finish() to get the result of the operation.

See UDisks.Drive.call_eject_sync() for the synchronous, blocking version of this method.

call_eject_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to UDisks.Drive.call_eject().

Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

Return type:

bool

Finishes an operation started with UDisks.Drive.call_eject().

call_eject_sync(arg_options, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

Return type:

bool

Synchronously invokes the Eject() D-Bus method on self. The calling thread is blocked until a reply is received.

See UDisks.Drive.call_eject() for the asynchronous version of this method.

call_power_off(arg_options, cancellable, callback, *user_data)
Parameters:

Asynchronously invokes the PowerOff() D-Bus method on self. When the operation is finished, callback will be invoked in the thread-default main loop of the thread you are calling this method from (see GLib.MainContext.push_thread_default()). You can then call UDisks.Drive.call_power_off_finish() to get the result of the operation.

See UDisks.Drive.call_power_off_sync() for the synchronous, blocking version of this method.

New in version 2.0.0.

call_power_off_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to UDisks.Drive.call_power_off().

Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

Return type:

bool

Finishes an operation started with UDisks.Drive.call_power_off().

New in version 2.0.0.

call_power_off_sync(arg_options, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

Return type:

bool

Synchronously invokes the PowerOff() D-Bus method on self. The calling thread is blocked until a reply is received.

See UDisks.Drive.call_power_off() for the asynchronous version of this method.

New in version 2.0.0.

call_set_configuration(arg_value, arg_options, cancellable, callback, *user_data)
Parameters:

Asynchronously invokes the SetConfiguration() D-Bus method on self. When the operation is finished, callback will be invoked in the thread-default main loop of the thread you are calling this method from (see GLib.MainContext.push_thread_default()). You can then call UDisks.Drive.call_set_configuration_finish() to get the result of the operation.

See UDisks.Drive.call_set_configuration_sync() for the synchronous, blocking version of this method.

call_set_configuration_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to UDisks.Drive.call_set_configuration().

Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

Return type:

bool

Finishes an operation started with UDisks.Drive.call_set_configuration().

call_set_configuration_sync(arg_value, arg_options, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

Return type:

bool

Synchronously invokes the SetConfiguration() D-Bus method on self. The calling thread is blocked until a reply is received.

See UDisks.Drive.call_set_configuration() for the asynchronous version of this method.

complete_eject(invocation)
Parameters:

invocation (Gio.DBusMethodInvocation) – A Gio.DBusMethodInvocation.

Helper function used in service implementations to finish handling invocations of the Eject() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.

This method will free invocation, you cannot use it afterwards.

complete_power_off(invocation)
Parameters:

invocation (Gio.DBusMethodInvocation) – A Gio.DBusMethodInvocation.

Helper function used in service implementations to finish handling invocations of the PowerOff() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.

This method will free invocation, you cannot use it afterwards.

New in version 2.0.0.

complete_set_configuration(invocation)
Parameters:

invocation (Gio.DBusMethodInvocation) – A Gio.DBusMethodInvocation.

Helper function used in service implementations to finish handling invocations of the SetConfiguration() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.

This method will free invocation, you cannot use it afterwards.

do_handle_eject(invocation, arg_options) virtual
Parameters:
Return type:

bool

do_handle_power_off(invocation, arg_options) virtual
Parameters:
Return type:

bool

do_handle_set_configuration(invocation, arg_value, arg_options) virtual
Parameters:
Return type:

bool

Signal Details

UDisks.Drive.signals.handle_eject(drive, invocation, arg_options)
Signal Name:

handle-eject

Flags:

RUN_LAST

Parameters:
Returns:

Gio.DBUS_METHOD_INVOCATION_HANDLED or True if the invocation was handled, Gio.DBUS_METHOD_INVOCATION_UNHANDLED or False to let other signal handlers run.

Return type:

bool

Signal emitted when a remote caller is invoking the Eject() D-Bus method.

If a signal handler returns True, it means the signal handler will handle the invocation (e.g. take a reference to invocation and eventually call UDisks.Drive.complete_eject() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the Gio.DBusError.UNKNOWN_METHOD error is returned.

UDisks.Drive.signals.handle_power_off(drive, invocation, arg_options)
Signal Name:

handle-power-off

Flags:

RUN_LAST

Parameters:
Returns:

Gio.DBUS_METHOD_INVOCATION_HANDLED or True if the invocation was handled, Gio.DBUS_METHOD_INVOCATION_UNHANDLED or False to let other signal handlers run.

Return type:

bool

Signal emitted when a remote caller is invoking the PowerOff() D-Bus method.

If a signal handler returns True, it means the signal handler will handle the invocation (e.g. take a reference to invocation and eventually call UDisks.Drive.complete_power_off() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the Gio.DBusError.UNKNOWN_METHOD error is returned.

New in version 2.0.0.

UDisks.Drive.signals.handle_set_configuration(drive, invocation, arg_value, arg_options)
Signal Name:

handle-set-configuration

Flags:

RUN_LAST

Parameters:
Returns:

Gio.DBUS_METHOD_INVOCATION_HANDLED or True if the invocation was handled, Gio.DBUS_METHOD_INVOCATION_UNHANDLED or False to let other signal handlers run.

Return type:

bool

Signal emitted when a remote caller is invoking the SetConfiguration() D-Bus method.

If a signal handler returns True, it means the signal handler will handle the invocation (e.g. take a reference to invocation and eventually call UDisks.Drive.complete_set_configuration() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the Gio.DBusError.UNKNOWN_METHOD error is returned.

Property Details

UDisks.Drive.props.can_power_off
Name:

can-power-off

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Represents the D-Bus property “CanPowerOff”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.configuration
Name:

configuration

Type:

GLib.Variant

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Configuration”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.connection_bus
Name:

connection-bus

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “ConnectionBus”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.ejectable
Name:

ejectable

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Ejectable”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Id”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.media
Name:

media

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Media”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.media_available
Name:

media-available

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Represents the D-Bus property “MediaAvailable”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.media_change_detected
Name:

media-change-detected

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Represents the D-Bus property “MediaChangeDetected”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.media_compatibility
Name:

media-compatibility

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

Represents the D-Bus property “MediaCompatibility”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.media_removable
Name:

media-removable

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Represents the D-Bus property “MediaRemovable”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.model
Name:

model

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Model”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.optical
Name:

optical

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Optical”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.optical_blank
Name:

optical-blank

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Represents the D-Bus property “OpticalBlank”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.optical_num_audio_tracks
Name:

optical-num-audio-tracks

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Represents the D-Bus property “OpticalNumAudioTracks”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.optical_num_data_tracks
Name:

optical-num-data-tracks

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Represents the D-Bus property “OpticalNumDataTracks”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.optical_num_sessions
Name:

optical-num-sessions

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Represents the D-Bus property “OpticalNumSessions”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.optical_num_tracks
Name:

optical-num-tracks

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Represents the D-Bus property “OpticalNumTracks”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.removable
Name:

removable

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Removable”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.revision
Name:

revision

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Revision”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.rotation_rate
Name:

rotation-rate

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Represents the D-Bus property “RotationRate”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.seat
Name:

seat

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Seat”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.serial
Name:

serial

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Serial”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.sibling_id
Name:

sibling-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “SiblingId”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.size
Name:

size

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Size”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.sort_key
Name:

sort-key

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “SortKey”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.time_detected
Name:

time-detected

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Represents the D-Bus property “TimeDetected”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.time_media_detected
Name:

time-media-detected

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Represents the D-Bus property “TimeMediaDetected”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.vendor
Name:

vendor

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “Vendor”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

UDisks.Drive.props.wwn
Name:

wwn

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property “WWN”.

Since the D-Bus property for this GObject.Object property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.