1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395
|
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="gio-functions">
<refnamediv>
<refname>gio Functions</refname>
<refpurpose></refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<programlisting><methodsynopsis language="python">
<methodname><link linkend="function-gio--content-type-can-be-executable">gio.content_type_can_be_executable</link></methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--content-type-equals">gio.content_type_equals</link></methodname>
<methodparam><parameter role="keyword">type1</parameter></methodparam>
<methodparam><parameter role="keyword">type2</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--content-type-from-mime-type">gio.content_type_from_mime_type</link></methodname>
<methodparam><parameter role="keyword">mime_type</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--content-type-get-description">gio.content_type_get_description</link></methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--content-type-get-icon">gio.content_type_get_icon</link></methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--content-type-get-mime-type">gio.content_type_get_mime_type</link></methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--content-type-guess">gio.content_type_guess</link></methodname>
<methodparam><parameter role="keyword">filename</parameter></methodparam>
<methodparam><parameter role="keyword">data</parameter></methodparam>
<methodparam><parameter role="keyword">want_uncertain</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--content-type-is-a">gio.content_type_is_a</link></methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
<methodparam><parameter role="keyword">supertype</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--content-type-is-unknown">gio.content_type_is_unknown</link></methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--content-types-get-registered">gio.content_types_get_registered</link></methodname>
<methodparam></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gio--io-error-from-errno">gio.io_error_from_errno</link></methodname>
<methodparam><parameter role="keyword">err_no</parameter></methodparam>
</methodsynopsis></programlisting>
</refsect1>
<refsect1>
<title>Description</title>
<para>
These functions are part of the <literal>PyGObject</literal> gio module
but are not directly associated with a specific class
</para>
</refsect1>
<refsect1>
<title>Functions</title>
<refsect2 id="function-gio--content-type-can-be-executable">
<title>gio.content_type_can_be_executable</title>
<programlisting><methodsynopsis language="python">
<methodname>content_type_can_be_executable</methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>type</parameter> :</term>
<listitem><simpara>a content type string.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the file type corresponds
to a type that can be executable, <literal>False</literal> otherwise.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>content_type_can_be_executable</methodname>() function checks
if a content type can be executable. Note that for instance things like text files
can be executables (i.e. scripts and batch files).
</para>
</refsect2>
<refsect2 id="function-gio--content-type-equals">
<title>gio.content_type_equals</title>
<programlisting><methodsynopsis language="python">
<methodname>content_type_equals</methodname>
<methodparam><parameter role="keyword">type1</parameter></methodparam>
<methodparam><parameter role="keyword">type2</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>type1</parameter> :</term>
<listitem><simpara>a content type string.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>type2</parameter> :</term>
<listitem><simpara>a content type string.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the two strings are
identical or equivalent, <literal>False</literal> otherwise.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>content_type_equals</methodname>() function compares
two content types for equality.
</para>
</refsect2>
<refsect2 id="function-gio--content-type-from-mime-type">
<title>gio.content_type_from_mime_type</title>
<programlisting><methodsynopsis language="python">
<methodname>content_type_from_mime_type</methodname>
<methodparam><parameter role="keyword">mime_type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>mime_type</parameter> :</term>
<listitem><simpara>a mime type string.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>The content type or <literal>None</literal> when does not know.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>content_type_from_mime_type</methodname>() function tries
to find a content type based on the mime type name.
</para>
</refsect2>
<refsect2 id="function-gio--content-type-get-description">
<title>gio.content_type_get_description</title>
<programlisting><methodsynopsis language="python">
<methodname>content_type_get_description</methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>type</parameter> :</term>
<listitem><simpara>a content type string.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a short description of the content type type.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>content_type_get_description</methodname>() function
gets the human readable description of the content type.
</para>
</refsect2>
<refsect2 id="function-gio--content-type-get-icon">
<title>gio.content_type_get_icon</title>
<programlisting><methodsynopsis language="python">
<methodname>content_type_get_icon</methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>type</parameter> :</term>
<listitem><simpara>a content type string.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>A <link linkend="class-gioicon"><classname>gio.Icon</classname></link>
corresponding to the content type.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>content_type_get_icon</methodname>() function
gets the icon for a content type.
</para>
</refsect2>
<refsect2 id="function-gio--content-type-get-mime-type">
<title>gio.content_type_get_mime_type</title>
<programlisting><methodsynopsis language="python">
<methodname>content_type_get_mime_type</methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>type</parameter> :</term>
<listitem><simpara>a content type string.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the registered mime-type for the given type,
or <literal>None</literal> if unknown.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>content_type_get_mime_type</methodname>() function
gets the mime-type for the content type. If one is registered
</para>
</refsect2>
<refsect2 id="function-gio--content-type-guess">
<title>gio.content_type_guess</title>
<programlisting><methodsynopsis language="python">
<methodname>content_type_guess</methodname>
<methodparam><parameter role="keyword">filename</parameter></methodparam>
<methodparam><parameter role="keyword">data</parameter></methodparam>
<methodparam><parameter role="keyword">want_uncertain</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>filename</parameter> :</term>
<listitem><simpara>a string, or <literal>None</literal>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>data</parameter> :</term>
<listitem><simpara>a stream of data, or <literal>None</literal>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>want_uncertain</parameter> :</term>
<listitem><simpara>a flag indicating the certainty of the result.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a string indicating a guessed content type for the given data.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>content_type_guess</methodname>() function guesses
the content type based on example data. If the function is uncertain,
result_uncertain will be set to <literal>True</literal>. Either filename
or data may be <literal>None</literal>, in which case the guess will be
based solely on the other argument.
</para>
</refsect2>
<refsect2 id="function-gio--content-type-is-a">
<title>gio.content_type_is_a</title>
<programlisting><methodsynopsis language="python">
<methodname>content_type_is_a</methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
<methodparam><parameter role="keyword">supertype</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>type</parameter> :</term>
<listitem><simpara>a content type string.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>supertype</parameter> :</term>
<listitem><simpara>a string.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if type is a kind of
supertype, <literal>False</literal> otherwise.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>content_type_is_a</methodname>() function determines
if type is a subset of supertype.
</para>
</refsect2>
<refsect2 id="function-gio--content-type-is-unknown">
<title>gio.content_type_is_unknown</title>
<programlisting><methodsynopsis language="python">
<methodname>content_type_is_unknown</methodname>
<methodparam><parameter role="keyword">type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>type</parameter> :</term>
<listitem><simpara>a content type string.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the type is the unknown type.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>content_type_is_unknown</methodname>() function checks if
the content type is the generic "unknown" type. On unix this is the
"application/octet-stream" mimetype, while on win32 it is "*".
</para>
</refsect2>
<refsect2 id="function-gio--content-types-get-registered">
<title>gio.content_types_get_registered</title>
<programlisting><methodsynopsis language="python">
<methodname>content_types_get_registered</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a list of the registered content types.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>content_types_get_registered</methodname>() function
gets a list of strings containing all the registered content types
known to the system.
</para>
</refsect2>
<refsect2 id="function-gio--io-error-from-errno">
<title>gio.io_error_from_errno</title>
<programlisting><methodsynopsis language="python">
<methodname>io_error_from_errno</methodname>
<methodparam><parameter role="keyword">err_no</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>err_no</parameter> :</term>
<listitem><simpara>Error number.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a
<xref linkend="gio-error-constants" endterm="gio-error-constants-title"></xref>
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>io_error_from_errno</methodname>() function converts
error codes into GIO error codes.
</para>
</refsect2>
</refsect1>
</refentry>
|