mirror of
https://github.com/python/cpython.git
synced 2025-10-01 12:52:18 +00:00
[3.6] bpo-30178: Indent methods and attributes of MimeType class (GH-1306) (#1570)
(cherry picked from commit c71168090d
)
This commit is contained in:
parent
d05f7fdf6c
commit
3a66ab8695
1 changed files with 43 additions and 43 deletions
|
@ -186,78 +186,78 @@ than one MIME-type database; it provides an interface similar to the one of the
|
||||||
loaded "on top" of the default database.
|
loaded "on top" of the default database.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: MimeTypes.suffix_map
|
.. attribute:: MimeTypes.suffix_map
|
||||||
|
|
||||||
Dictionary mapping suffixes to suffixes. This is used to allow recognition of
|
Dictionary mapping suffixes to suffixes. This is used to allow recognition of
|
||||||
encoded files for which the encoding and the type are indicated by the same
|
encoded files for which the encoding and the type are indicated by the same
|
||||||
extension. For example, the :file:`.tgz` extension is mapped to :file:`.tar.gz`
|
extension. For example, the :file:`.tgz` extension is mapped to :file:`.tar.gz`
|
||||||
to allow the encoding and type to be recognized separately. This is initially a
|
to allow the encoding and type to be recognized separately. This is initially a
|
||||||
copy of the global :data:`suffix_map` defined in the module.
|
copy of the global :data:`suffix_map` defined in the module.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: MimeTypes.encodings_map
|
.. attribute:: MimeTypes.encodings_map
|
||||||
|
|
||||||
Dictionary mapping filename extensions to encoding types. This is initially a
|
Dictionary mapping filename extensions to encoding types. This is initially a
|
||||||
copy of the global :data:`encodings_map` defined in the module.
|
copy of the global :data:`encodings_map` defined in the module.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: MimeTypes.types_map
|
.. attribute:: MimeTypes.types_map
|
||||||
|
|
||||||
Tuple containing two dictionaries, mapping filename extensions to MIME types:
|
Tuple containing two dictionaries, mapping filename extensions to MIME types:
|
||||||
the first dictionary is for the non-standards types and the second one is for
|
the first dictionary is for the non-standards types and the second one is for
|
||||||
the standard types. They are initialized by :data:`common_types` and
|
the standard types. They are initialized by :data:`common_types` and
|
||||||
:data:`types_map`.
|
:data:`types_map`.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: MimeTypes.types_map_inv
|
.. attribute:: MimeTypes.types_map_inv
|
||||||
|
|
||||||
Tuple containing two dictionaries, mapping MIME types to a list of filename
|
Tuple containing two dictionaries, mapping MIME types to a list of filename
|
||||||
extensions: the first dictionary is for the non-standards types and the
|
extensions: the first dictionary is for the non-standards types and the
|
||||||
second one is for the standard types. They are initialized by
|
second one is for the standard types. They are initialized by
|
||||||
:data:`common_types` and :data:`types_map`.
|
:data:`common_types` and :data:`types_map`.
|
||||||
|
|
||||||
|
|
||||||
.. method:: MimeTypes.guess_extension(type, strict=True)
|
.. method:: MimeTypes.guess_extension(type, strict=True)
|
||||||
|
|
||||||
Similar to the :func:`guess_extension` function, using the tables stored as part
|
Similar to the :func:`guess_extension` function, using the tables stored as part
|
||||||
of the object.
|
of the object.
|
||||||
|
|
||||||
|
|
||||||
.. method:: MimeTypes.guess_type(url, strict=True)
|
.. method:: MimeTypes.guess_type(url, strict=True)
|
||||||
|
|
||||||
Similar to the :func:`guess_type` function, using the tables stored as part of
|
Similar to the :func:`guess_type` function, using the tables stored as part of
|
||||||
the object.
|
the object.
|
||||||
|
|
||||||
|
|
||||||
.. method:: MimeTypes.guess_all_extensions(type, strict=True)
|
.. method:: MimeTypes.guess_all_extensions(type, strict=True)
|
||||||
|
|
||||||
Similar to the :func:`guess_all_extensions` function, using the tables stored
|
Similar to the :func:`guess_all_extensions` function, using the tables stored
|
||||||
as part of the object.
|
as part of the object.
|
||||||
|
|
||||||
|
|
||||||
.. method:: MimeTypes.read(filename, strict=True)
|
.. method:: MimeTypes.read(filename, strict=True)
|
||||||
|
|
||||||
Load MIME information from a file named *filename*. This uses :meth:`readfp` to
|
Load MIME information from a file named *filename*. This uses :meth:`readfp` to
|
||||||
parse the file.
|
parse the file.
|
||||||
|
|
||||||
If *strict* is ``True``, information will be added to list of standard types,
|
If *strict* is ``True``, information will be added to list of standard types,
|
||||||
else to the list of non-standard types.
|
else to the list of non-standard types.
|
||||||
|
|
||||||
|
|
||||||
.. method:: MimeTypes.readfp(fp, strict=True)
|
.. method:: MimeTypes.readfp(fp, strict=True)
|
||||||
|
|
||||||
Load MIME type information from an open file *fp*. The file must have the format of
|
Load MIME type information from an open file *fp*. The file must have the format of
|
||||||
the standard :file:`mime.types` files.
|
the standard :file:`mime.types` files.
|
||||||
|
|
||||||
If *strict* is ``True``, information will be added to the list of standard
|
If *strict* is ``True``, information will be added to the list of standard
|
||||||
types, else to the list of non-standard types.
|
types, else to the list of non-standard types.
|
||||||
|
|
||||||
|
|
||||||
.. method:: MimeTypes.read_windows_registry(strict=True)
|
.. method:: MimeTypes.read_windows_registry(strict=True)
|
||||||
|
|
||||||
Load MIME type information from the Windows registry. Availability: Windows.
|
Load MIME type information from the Windows registry. Availability: Windows.
|
||||||
|
|
||||||
If *strict* is ``True``, information will be added to the list of standard
|
If *strict* is ``True``, information will be added to the list of standard
|
||||||
types, else to the list of non-standard types.
|
types, else to the list of non-standard types.
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue