rbtools.api.utils¶
API-specific MIME type utilities.
Functions
|
Parse a MIME type into its component parts. |
|
Strip the subtype from a mimetype, leaving vendor specific information. |
Classes
A parsed MIME type for resources. |
- class rbtools.api.utils.ParsedMIMEType[source]¶
Bases:
MIMEType
A parsed MIME type for resources.
New in version 4.0.
- resource: str¶
The particular API resource name, if available.
For example, “test” in “application/vnd.reviewboard.org.test+json”.
- Type:
- __optional_keys__ = frozenset({})¶
- __orig_bases__ = (<class 'rbtools.utils.mimetypes.MIMEType'>,)¶
- __required_keys__ = frozenset({'format', 'main_type', 'resource', 'sub_type', 'type', 'vendor'})¶
- __total__ = True¶
- rbtools.api.utils.parse_mimetype(mime_type: str) ParsedMIMEType [source]¶
Parse a MIME type into its component parts.
- Parameters:
mime_type (
str
) – The MIME type to parse.- Returns:
The type, parsed into its component parts.
- Return type: