File: //usr/libexec/oracle-cloud-agent/plugins/osms/mimeparse.pyc
a
[��ff � @ sh d dl Z dZdZdZdZdZG dd� de�Zd d
� Zdd� Z d
d� Z
dd� Zdd� Zdd� Z
dd� ZdS )� Nz1.6.0zJoe Gregoriozjoe@bitworking.orgzMIT License� c @ s e Zd ZdS )�MimeTypeParseExceptionN)�__name__�
__module__�__qualname__� r r �m/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/mimeparse.pyr
s r c C sh t �| �\}}|dkrd}d|v r,|�d�nd}|r@t|�dkrNtd�|���|\}}|�� |�� |fS )an Parses a mime-type into its component parts.
Carves up a mime-type and returns a tuple of the (type, subtype, params)
where 'params' is a dictionary of all the parameters for the media range.
For example, the media range 'application/xhtml;q=0.5' would get parsed
into:
('application', 'xhtml', {'q', '0.5'})
:rtype: (str,str,dict)
�*z*/*�/N� zCan't parse type "{}")�cgi�parse_header�split�lenr �format�strip)� mime_type� full_type�params�
type_parts�type�subtyper r r �parse_mime_type s �r c C sz t | �\}}}|�d|�dd�� z2|d rJdt|d � krHdksRn d|d<