Imported Upstream version 2.28.4
[platform/upstream/pygobject2.git] / docs / html / class-giovolume.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gio.Volume</title><link rel="stylesheet" type="text/css" href="style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="PyGObject Reference Manual"><link rel="up" href="gio-class-reference.html" title="PyGio Class Reference"><link rel="prev" href="class-giothemedicon.html" title="gio.ThemedIcon"><link rel="next" href="class-giovolumemonitor.html" title="gio.VolumeMonitor"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gio.Volume</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-giothemedicon.html">Prev</a> </td><th width="60%" align="center">PyGio Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-giovolumemonitor.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gio.Volume"><a name="class-giovolume"></a><div class="titlepage"></div><div class="refnamediv"><h2>gio.Volume</h2><p>gio.Volume — Volume management.</p></div><div class="refsect1" title="Synopsis"><a name="id749106"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gio.Volume</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gobjectginterface.html" title="gobject.GInterface">gobject.GInterface</a></span></span>):
2 <code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--can-eject" title="gio.Volume.can_eject">can_eject</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--can-mount" title="gio.Volume.can_mount">can_mount</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--eject" title="gio.Volume.eject">eject</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</code></strong></span><span class="initializer">=gio.MOUNT_UNMOUNT_NONE</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cancellable</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>user_data</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--eject-finish" title="gio.Volume.eject_finish">eject_finish</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>result</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--enumerate-identifiers" title="gio.Volume.enumerate_identifiers">enumerate_identifiers</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--get-activation-root" title="gio.Volume.get_activation_root">get_activation_root</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--get-drive" title="gio.Volume.get_drive">get_drive</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--get-icon" title="gio.Volume.get_icon">get_icon</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--get-identifier" title="gio.Volume.get_identifier">get_identifier</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--get-mount" title="gio.Volume.get_mount">get_mount</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--get-name" title="gio.Volume.get_name">get_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--get-uuid" title="gio.Volume.get_uuid">get_uuid</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--mount" title="gio.Volume.mount">mount</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mount_operation</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</code></strong></span><span class="initializer">=gio.MOUNT_MOUNT_NONE</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cancellable</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>user_data</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--mount-finish" title="gio.Volume.mount_finish">mount_finish</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>result</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--should-automount" title="gio.Volume.should_automount">should_automount</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id749595"></a><h2>Ancestry</h2><pre class="synopsis">+-- <a class="link" href="class-gobjectginterface.html" title="gobject.GInterface">gobject.GInterface</a>
3   +-- <a class="link" href="class-giovolume.html" title="gio.Volume">gio.Volume</a>
4 </pre></div><div class="refsect1" title="Prerequisites"><a name="id749621"></a><h2>Prerequisites</h2><p>
5             <a class="link" href="class-giovolume.html" title="gio.Volume"><code class="classname">gio.Volume</code></a> requires
6             <a class="link" href="class-gobject.html" title="gobject.GObject"><code class="classname">gobject.GObject</code></a>
7         </p></div><div class="refsect1" title="gio.Volume Signal Prototypes"><a name="signal-prototypes-giovolume"></a><h2>gio.Volume Signal Prototypes</h2><p><a class="link" href="class-gobject.html#signal-prototypes-gobject" title="gobject.GObject Signal Prototypes">gobject.GObject Signal Prototypes</a></p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><a class="link" href="class-giovolume.html#signal-giovolume--changed" title='The "changed" gio.Volume Signal'>"changed"</a></span></p></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>volume</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term"><a class="link" href="class-giovolume.html#signal-giovolume--removed" title='The "removed" gio.Volume Signal'>"removed"</a></span></p></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>volume</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" title="Description"><a name="id749785"></a><h2>Description</h2><p>
8             The <a class="link" href="class-giovolume.html" title="gio.Volume"><code class="classname">gio.Volume</code></a>
9             interface represents user-visible objects that can be mounted. Note, when porting
10             from GnomeVFS, <a class="link" href="class-giovolume.html" title="gio.Volume"><code class="classname">gio.Volume</code></a>
11             is the moral equivalent of GnomeVFSDrive. 
12         </p><p>
13             Mounting a <a class="link" href="class-giovolume.html" title="gio.Volume"><code class="classname">gio.Volume</code></a>
14             instance is an asynchronous operation. For more information about asynchronous operations.
15             To mount a <a class="link" href="class-giovolume.html" title="gio.Volume"><code class="classname">gio.Volume</code></a>, first call
16             <code class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--mount" title="gio.Volume.mount">gio.Volume.mount</a></code>()
17             with (at least) the <a class="link" href="class-giovolume.html" title="gio.Volume"><code class="classname">gio.Volume</code></a>
18             instance, optionally a
19             <a class="link" href="class-giomountoperation.html" title="gio.MountOperation"><code class="classname">gio.MountOperation</code></a>
20             object and a GAsyncReadyCallback. 
21         </p><p>
22             Typically, one will only want to pass <code class="literal">None</code> for the GMountOperation
23             if automounting all volumes when a desktop session starts since it's not desirable
24             to put up a lot of dialogs asking for credentials. 
25         </p><p>
26             The callback will be fired when the operation has resolved (either with success or failure),
27             and a GAsyncReady structure will be passed to the callback. That callback should then call
28             <code class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--mount-finish" title="gio.Volume.mount_finish">gio.Volume.mount_finish</a></code>()
29             with the GVolume instance and the GAsyncReady data to see if the operation was completed
30             successfully. If an error is present when
31             <code class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--mount-finish" title="gio.Volume.mount_finish">gio.Volume.mount_finish</a></code>()
32             is called, then it will be filled with any error information. 
33         </p><p>
34             It is sometimes necessary to directly access the underlying operating system object behind a volume
35             (e.g. for passing a volume to an application via the commandline). For this purpose, GIO allows to obtain
36             an 'identifier' for the volume. There can be different kinds of identifiers, such as Hal UDIs,
37             filesystem labels, traditional Unix devices (e.g. /dev/sda2), uuids. GIO uses predefind strings
38             as names for the different kinds of identifiers:
39             "hal-udi", "label", etc. Use
40             <code class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--get-identifier" title="gio.Volume.get_identifier">gio.Volume.get_identifier</a></code>()
41             to obtain an identifier for a volume. 
42         </p></div><div class="refsect1" title="Methods"><a name="id749902"></a><h2>Methods</h2><div class="refsect2" title="gio.Volume.can_eject"><a name="method-giovolume--can-eject"></a><h3>gio.Volume.can_eject</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">can_eject</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the volume can be ejected,
43                     <code class="literal">False</code> otherwise.
44                     </td></tr></tbody></table><p>
45                 The <code class="methodname">can_eject</code>() method checks if a volume can be ejected.
46             </p></div><div class="refsect2" title="gio.Volume.can_mount"><a name="method-giovolume--can-mount"></a><h3>gio.Volume.can_mount</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">can_mount</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the volume can be mounted
47                     for media changes, <code class="literal">False</code> otherwise. 
48                     </td></tr></tbody></table><p>
49                 The <code class="methodname">can_mount</code>() method checks if a volume
50                 can be mounted.
51             </p></div><div class="refsect2" title="gio.Volume.eject"><a name="method-giovolume--eject"></a><h3>gio.Volume.eject</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">eject</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</code></strong></span><span class="initializer">=gio.MOUNT_UNMOUNT_NONE</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cancellable</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>user_data</code></strong></span><span class="initializer">=None</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>callback</code></strong> :</span></p></td><td>A GAsyncReadyCallback to call when the request is satisfied.
52                   </td></tr><tr><td><p><span class="term"><strong class="parameter"><code>flags</code></strong> :</span></p></td><td>flags affecting the unmount if required for eject.
53                   </td></tr><tr><td><p><span class="term"><strong class="parameter"><code>cancellable</code></strong> :</span></p></td><td>Optional
54                   <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
55                   object, <code class="literal">None</code> to ignore.
56                   </td></tr><tr><td><p><span class="term"><strong class="parameter"><code>user_data</code></strong> :</span></p></td><td>The data to pass to callback function.
57                   </td></tr></tbody></table><p>
58                 The <code class="methodname">eject</code>() method asynchronously ejects a volume. 
59             </p><p>
60                 When the operation is finished, callback will be called. You can then call
61                 <code class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--eject-finish" title="gio.Volume.eject_finish">gio.Volume.eject_finish</a></code>()
62                 to obtain the result of the operation.
63             </p></div><div class="refsect2" title="gio.Volume.eject_finish"><a name="method-giovolume--eject-finish"></a><h3>gio.Volume.eject_finish</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">eject_finish</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>result</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>result</code></strong> :</span></p></td><td>a <a class="link" href="class-gioasyncresult.html" title="gio.AsyncResult"><code class="classname">gio.AsyncResult</code></a>.
64                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the volume has been ejected
65                     successfully, <code class="literal">False</code> otherwise.
66                     </td></tr></tbody></table><p>
67                 The <code class="methodname">eject_finish</code>() method finishes ejecting a volume.
68                 If any errors occured during the operation, error will be set to contain the
69                 errors and <code class="literal">False</code> will be returned.
70             </p></div><div class="refsect2" title="gio.Volume.enumerate_identifiers"><a name="method-giovolume--enumerate-identifiers"></a><h3>gio.Volume.enumerate_identifiers</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">enumerate_identifiers</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list of strings containing kinds of identifiers.
71                     </td></tr></tbody></table><p>
72                 The <code class="methodname">enumerate_identifiers</code>() method gets the kinds
73                 of identifiers that volume has. Use
74                 <code class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--get-identifier" title="gio.Volume.get_identifier">gio.Volume.get_identifier</a></code>()
75                 to obtain the identifiers themselves.
76             </p></div><div class="refsect2" title="gio.Volume.get_activation_root"><a name="method-giovolume--get-activation-root"></a><h3>gio.Volume.get_activation_root</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_activation_root</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the activation root of volume or <code class="literal">None</code>.
77                     </td></tr></tbody></table><p>
78                 The <code class="methodname">get_activation_root</code>() method gets the activation
79                 root for a <a class="link" href="class-giovolume.html" title="gio.Volume"><code class="classname">gio.Volume</code></a>
80                 if it is known ahead of mount time. Returns <code class="literal">None</code> otherwise.
81                 If not <code class="literal">None</code> and if volume is mounted, then the result of
82                 <code class="methodname"><a class="link" href="class-giomount.html#method-giomount--get-root" title="gio.Mount.get_root">gio.Mount.get_root</a></code>()
83                 on the GMount object obtained from
84                 <code class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--get-mount" title="gio.Volume.get_mount">gio.Volume.get_mount</a></code>()
85                 will always either be equal or a prefix of what this function returns.
86                 In other words, in code:
87             </p><pre class="programlisting">
88 mount = volume.get_mount() # mounted, so never None
89 mount_root = mount.get_root()
90 volume_activation_root = volume.get_activation_root() # assume not None
91 </pre><p>
92                 then the expression
93             </p><pre class="programlisting">
94 volume_activation_root.has_prefix(mount_root) || volume_activation_root.equal(mount_root)
95 </pre><p>
96                 will always be <code class="literal">True</code>.
97             </p><p>
98                 Activation roots are typically used in
99                 <a class="link" href="class-giovolumemonitor.html" title="gio.VolumeMonitor"><code class="classname">gio.VolumeMonitor</code></a>
100                 implementations to find the underlying mount to shadow, see
101                 <code class="methodname"><a class="link" href="class-giomount.html#method-giomount--is-shadowed" title="gio.Mount.is_shadowed">gio.Mount.is_shadowed</a></code>()
102                 for more details.
103             </p></div><div class="refsect2" title="gio.Volume.get_drive"><a name="method-giovolume--get-drive"></a><h3>gio.Volume.get_drive</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_drive</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>A <a class="link" href="class-giodrive.html" title="gio.Drive"><code class="classname">gio.Drive</code></a>
104                     or <code class="literal">None</code> if volume is not associated with a drive.
105                     </td></tr></tbody></table><p>
106                 The <code class="methodname">get_drive</code>() method gets the drive for the volume.
107             </p></div><div class="refsect2" title="gio.Volume.get_icon"><a name="method-giovolume--get-icon"></a><h3>gio.Volume.get_icon</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_icon</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><a class="link" href="class-gioicon.html" title="gio.Icon"><code class="classname">gio.Icon</code></a>
108                     for the volume.
109                     </td></tr></tbody></table><p>
110                 The <code class="methodname">get_icon</code>() method gets the icon for volume.
111             </p></div><div class="refsect2" title="gio.Volume.get_identifier"><a name="method-giovolume--get-identifier"></a><h3>gio.Volume.get_identifier</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_identifier</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>A string containing the requested identfier, or
112                     <code class="literal">None</code> if the
113                     <a class="link" href="class-giovolume.html" title="gio.Volume"><code class="classname">gio.Volume</code></a>
114                     doesn't have this kind of identifier. 
115                     </td></tr></tbody></table><p>
116                 The <code class="methodname">get_identifier</code>() method gets the identifier of
117                 the given kind for volume.
118             </p></div><div class="refsect2" title="gio.Volume.get_mount"><a name="method-giovolume--get-mount"></a><h3>gio.Volume.get_mount</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_mount</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>A 
119                     <a class="link" href="class-giomount.html" title="gio.Mount"><code class="classname">gio.Mount</code></a>
120                     or <code class="literal">None</code> if volume isn't mounted.
121                     </td></tr></tbody></table><p>
122                 The <code class="methodname">get_mount</code>() method gets the mount for the volume.
123             </p></div><div class="refsect2" title="gio.Volume.get_name"><a name="method-giovolume--get-name"></a><h3>gio.Volume.get_name</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_name</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>A string containing volume's name.
124                     </td></tr></tbody></table><p>
125                 The <code class="methodname">get_name</code>() method gets the name of volume.
126             </p></div><div class="refsect2" title="gio.Volume.get_uuid"><a name="method-giovolume--get-uuid"></a><h3>gio.Volume.get_uuid</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_uuid</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the UUID for volume or <code class="literal">None</code>
127                     if no UUID can be computed.
128                     </td></tr></tbody></table><p>
129                 The <code class="methodname">get_uuid</code>() method gets the UUID for the volume.
130                 The reference is typically based on the file system UUID for the volume in
131                 question and should be considered an opaque string.
132                 Returns <code class="literal">None</code> if there is no UUID available.
133             </p></div><div class="refsect2" title="gio.Volume.mount"><a name="method-giovolume--mount"></a><h3>gio.Volume.mount</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">mount</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mount_operation</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</code></strong></span><span class="initializer">=gio.MOUNT_MOUNT_NONE</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cancellable</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>user_data</code></strong></span><span class="initializer">=None</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>mount_operation</code></strong> :</span></p></td><td>A
134                   <a class="link" href="class-giomountoperation.html" title="gio.MountOperation"><code class="classname">gio.MountOperation</code></a>
135                   or <code class="literal">None</code> to avoid user interaction. 
136                   </td></tr><tr><td><p><span class="term"><strong class="parameter"><code>callback</code></strong> :</span></p></td><td>A GAsyncReadyCallback to call when the request is satisfied.
137                   </td></tr><tr><td><p><span class="term"><strong class="parameter"><code>flags</code></strong> :</span></p></td><td>Flags affecting the operation 
138                   </td></tr><tr><td><p><span class="term"><strong class="parameter"><code>cancellable</code></strong> :</span></p></td><td>Optional
139                   <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
140                   object, <code class="literal">None</code> to ignore.
141                   </td></tr><tr><td><p><span class="term"><strong class="parameter"><code>user_data</code></strong> :</span></p></td><td>The data to pass to callback function.
142                   </td></tr></tbody></table><p>
143                 The <code class="methodname">mount</code>() method mounts a volume. This is an
144                 asynchronous operation, and is finished by calling
145                 <code class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--mount-finish" title="gio.Volume.mount_finish">gio.Volume.mount_finish</a></code>()
146                 with the volume and GAsyncResult returned in the callback.
147             </p></div><div class="refsect2" title="gio.Volume.mount_finish"><a name="method-giovolume--mount-finish"></a><h3>gio.Volume.mount_finish</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">mount_finish</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>result</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>result</code></strong> :</span></p></td><td>a <a class="link" href="class-gioasyncresult.html" title="gio.AsyncResult"><code class="classname">gio.AsyncResult</code></a>.
148                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the volume has been mounted
149                     successfully, <code class="literal">False</code> otherwise.
150                     </td></tr></tbody></table><p>
151                 The <code class="methodname">mounted</code>() method finishes mounting a volume.
152                 If any errors occured during the operation, error will be set to contain
153                 the errors and <code class="literal">False</code> will be returned. 
154             </p><p>
155                 If the mount operation succeeded,
156                 <code class="methodname"><a class="link" href="class-giovolume.html#method-giovolume--get-mount" title="gio.Volume.get_mount">get_mount</a></code>()
157                 on volume is guaranteed to return the mount right after calling this function;
158                 there's no need to listen for the 'mount-added' signal on
159                 <a class="link" href="class-giovolumemonitor.html" title="gio.VolumeMonitor"><code class="classname">gio.VolumeMonitor</code></a>.
160             </p></div><div class="refsect2" title="gio.Volume.should_automount"><a name="method-giovolume--should-automount"></a><h3>gio.Volume.should_automount</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">should_automount</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the volume should
161                     be automatically mounted. 
162                     </td></tr></tbody></table><p>
163                 The <code class="methodname">should_automount</code>() method returns whether
164                 the volume should be automatically mounted.
165             </p></div></div><div class="refsect1" title="Signals"><a name="id751460"></a><h2>Signals</h2><div class="refsect2" title='The "changed" gio.Volume Signal'><a name="signal-giovolume--changed"></a><h3>The "changed" gio.Volume Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>volume</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>volume</code></em> :</span></p></td><td>the volume</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
166                     with the <a class="link" href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><code class="methodname">connect</code>()</a>
167                     method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if any)</td></tr></tbody></table><p>
168                 Emitted when the volume has been changed.
169             </p></div><div class="refsect2" title='The "removed" gio.Volume Signal'><a name="signal-giovolume--removed"></a><h3>The "removed" gio.Volume Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>volume</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>volume</code></em> :</span></p></td><td>the volume</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
170                     with the <a class="link" href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><code class="methodname">connect</code>()</a>
171                     method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if any)</td></tr></tbody></table><p>
172                 This signal is emitted when the
173                 <a class="link" href="class-giovolume.html" title="gio.Volume"><code class="classname">gio.Volume</code></a>
174                 have been removed. If the recipient is holding references to the object
175                 they should release them so the object can be finalized.
176             </p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-giothemedicon.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gio-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-giovolumemonitor.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gio.ThemedIcon </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gio.VolumeMonitor</td></tr></table></div></body></html>