Description
The gio.MountOperation
provides a mechanism for authenticating mountable operations, such as loop mounting files,
hard drive partitions or server locations.
Mounting operations are handed a
gio.MountOperation
that then can use if they require any privileges or authentication for their volumes to be
mounted (e.g. a hard disk partition or an encrypted filesystem), or if they are implementing
a remote server protocol which requires user credentials such as FTP or WebDAV.
Users should instantiate a subclass of this that implements all the various callbacks
to show the required dialogs, such as
gtk.MountOperation
.
Methods
gio.MountOperation.get_anonymous
def get_anonymous()
Returns : | True if mount operation is anonymous.
|
The get_anonymous
() method check to see whether
the mount operation is being used for an anonymous user
gio.MountOperation.get_choice
def get_choice()
Returns : | an integer containing an index of the user's
choice from the choice's list, or 0.
|
The get_anonymous
() method gets a choice
from the mount operation.
gio.MountOperation.get_domain
def get_domain()
Returns : | a string set to the domain.
|
The get_domain
() method gets the domain
of the mount operation.
gio.MountOperation.get_password
def get_password()
Returns : | a string containing the password within
the mountoperation.
|
The get_password
() method gets a password
from the mount operation.
gio.MountOperation.get_password_save
def get_password_save()
The get_password_save
() method gets the state
of saving passwords for the mount operation.
gio.MountOperation.get_username
def get_username()
Returns : | a string containing the user name.
|
The get_username
() method get the user
name from the mount operation.
gio.MountOperation.reply
def reply(result
)
The reply
() method emits the "reply" signal.
gio.MountOperation.set_anonymous
def set_anonymous(anonymous
)
anonymous :
| boolean value.
|
The set_anonymous
() method sets the mount operation
to use an anonymous user if anonymous is True
.
gio.MountOperation.set_choice
def set_choice(choice
)
The set_choice
() method sets a default choice for the mount operation.
gio.MountOperation.set_domain
def set_domain(domain
)
domain :
| the domain to set.
|
The set_domain
() method sets the mount operation's domain.
gio.MountOperation.set_password
def set_password(password
)
password :
| password to set.
|
The set_password
() method sets the mount
operation's password to password.
gio.MountOperation.set_password_save
def set_password_save(save
)
The set_password_save
() method sets the state
of saving passwords for the mount operation.
gio.MountOperation.set_username
def set_username(username
)
username :
| input username.
|
The set_anonymous
() method sets the user
name within op to username.
Signals
The "aborted" gio.MountOperation Signal
def callback(mountoperation
, user_param1
, ...
)
mountoperation :
| the mountoperation |
user_param1 :
| the first user parameter (if any) specified
with the connect ()
method |
... :
| additional user parameters (if any) |
Emitted by the backend when e.g. a device becomes unavailable while a mount operation is in progress.
Implementations of gio.MountOperation
should handle this signal by dismissing open password dialogs.
The "ask-password" gio.MountOperation Signal
def callback(mountoperation
, message
, default_user
, default_domain
, flags
, user_param1
, ...
)
mountoperation :
| the mountoperation |
message :
| string containing a message to display to the user. |
default_user :
| string containing the default user name. |
default_domain :
| string containing the default domain. |
flags :
| a set of
Gio Ask Password Flags Constants
|
user_param1 :
| the first user parameter (if any) specified
with the connect ()
method |
... :
| additional user parameters (if any) |
This signal is emitted when a mount operation asks the user for a password.
If the message contains a line break, the first line should be presented as a heading.
For example, it may be used as the primary text in a
gtk.MessageDialog
.
The "ask-question" gio.MountOperation Signal
def callback(mountoperation
, message
, choices
, user_param1
, ...
)
mountoperation :
| the mountoperation |
message :
| string containing a message to display to the user. |
choices :
| a list of strings for each possible choice. |
user_param1 :
| the first user parameter (if any) specified
with the connect ()
method |
... :
| additional user parameters (if any) |
This signal is emitted when asking the user a question and gives a list of choices
for the user to choose from. If the message contains a line break, the first line should be
presented as a heading. For example, it may be used as the primary text in a
gtk.MessageDialog
.
The "reply" gio.MountOperation Signal
def callback(mountoperation
, result
, user_param1
, ...
)
mountoperation :
| the mountoperation |
result :
| a
Gio Mount Operation Result Constants
indicating how the request was handled |
user_param1 :
| the first user parameter (if any) specified
with the connect ()
method |
... :
| additional user parameters (if any) |
This signal is emitted when the user has replied to the mount operation.