From de3463223b29fbd2b7589461731e0e2799c0b910 Mon Sep 17 00:00:00 2001 From: Subrahmanya Gaonkar Date: Fri, 26 Jul 2024 10:28:42 +0530 Subject: [PATCH 1/5] Successfully added addtype method under MimeTypes class --- Doc/library/mimetypes.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst index 91e8c30f8607b3..577a82eb6e573a 100644 --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -295,3 +295,13 @@ than one MIME-type database; it provides an interface similar to the one of the types, else to the list of non-standard types. .. versionadded:: 3.2 + + + .. method:: MimeTypes.add_type(type, ext, strict=True) + + Add a mapping from the MIME type *type* to the extension *ext*. When the + extension is already known, the new type will replace the old one. When the type + is already known the extension will be added to the list of known extensions. + + When *strict* is ``True`` (the default), the mapping will be added to the + official MIME types, otherwise to the non-standard ones. \ No newline at end of file From 89207d157a203e9b7be796dc3dc81b46773640fc Mon Sep 17 00:00:00 2001 From: Subrahmanya Gaonkar Date: Fri, 26 Jul 2024 11:39:25 +0530 Subject: [PATCH 2/5] added a new blank line --- Doc/library/mimetypes.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst index 577a82eb6e573a..89f537e0173e18 100644 --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -304,4 +304,5 @@ than one MIME-type database; it provides an interface similar to the one of the is already known the extension will be added to the list of known extensions. When *strict* is ``True`` (the default), the mapping will be added to the - official MIME types, otherwise to the non-standard ones. \ No newline at end of file + official MIME types, otherwise to the non-standard ones. + \ No newline at end of file From b03a832fd81211fc21e81469fed8c54bde349f1c Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 26 Jul 2024 22:38:15 +0100 Subject: [PATCH 3/5] Remove whitespace --- Doc/library/mimetypes.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst index 89f537e0173e18..8241a99eabe964 100644 --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -296,7 +296,6 @@ than one MIME-type database; it provides an interface similar to the one of the .. versionadded:: 3.2 - .. method:: MimeTypes.add_type(type, ext, strict=True) Add a mapping from the MIME type *type* to the extension *ext*. When the @@ -304,5 +303,5 @@ than one MIME-type database; it provides an interface similar to the one of the is already known the extension will be added to the list of known extensions. When *strict* is ``True`` (the default), the mapping will be added to the - official MIME types, otherwise to the non-standard ones. + official MIME types, otherwise to the non-standard ones. \ No newline at end of file From 248058861e5173ed2403b29f3a214cfe407357d8 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Fri, 26 Jul 2024 22:40:27 +0100 Subject: [PATCH 4/5] Remove whitespace (again) --- Doc/library/mimetypes.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst index 8241a99eabe964..54352c5f0e123d 100644 --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -304,4 +304,3 @@ than one MIME-type database; it provides an interface similar to the one of the When *strict* is ``True`` (the default), the mapping will be added to the official MIME types, otherwise to the non-standard ones. - \ No newline at end of file From e41ea05c599d3f3cedbbad392348d5b53462f210 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Fri, 26 Jul 2024 22:44:08 +0100 Subject: [PATCH 5/5] Add whitespace --- Doc/library/mimetypes.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst index 54352c5f0e123d..8ad4850584a7e1 100644 --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -296,6 +296,7 @@ than one MIME-type database; it provides an interface similar to the one of the .. versionadded:: 3.2 + .. method:: MimeTypes.add_type(type, ext, strict=True) Add a mapping from the MIME type *type* to the extension *ext*. When the