Dashboard
PHP:
8.2.30
OS:
Linux
User:
dh_nv8b2m
/
/
usr
/
lib
/
python3
/
dist-packages
/
xdg
/
__pycache__
📤 Upload
📝 New File
📁 New Folder
Close
Editing: Mime.cpython-310.pyc
o '8�_�f � @ s� d Z ddlZddlZddlZddlZddlZddlmZ ddlZddl m Z mZ ddlm Z dZi ZdZdadZdaejd dkZdd � ZdCd d�ZG dd � d e�ZG dd� de�ZG dd� de�ZG dd� d�ZG dd� de�ZG dd� d�Z G dd� de�Z!edd�Z"edd�Z#edd�Z$edd �Z%edd!�Z&edd"�Z'edd#�Z(edd$�Z)edd%�Z*edd&�Z+d'a,d(d)� Z-d*d+� Z.d,d-� Z/dDd/d0�Z0dDd1d2�Z1d3d4� Z2dEd6d7�Z3dFd8d9�Z4d:d;� Z5er�d<d=� Z6nd>d=� Z6da7d'a8d?d@� Z9dAdB� Z:dS )Ga� This module is based on a rox module (LGPL): http://cvs.sourceforge.net/viewcvs.py/rox/ROX-Lib2/python/rox/mime.py?rev=1.21&view=log This module provides access to the shared MIME database. types is a dictionary of all known MIME types, indexed by the type name, e.g. types['application/x-python'] Applications can install information about MIME types by storing an XML file as <MIME>/packages/<application>.xml and running the update-mime-database command, which is provided by the freedesktop.org shared mime database package. See http://www.freedesktop.org/standards/shared-mime-info-spec/ for information about the format of these files. (based on version 0.13) � N)� BaseDirectory)�minidom� XML_NAMESPACE)�defaultdictz5http://www.freedesktop.org/standards/shared-mime-info� c C s d� dd� | jD ���� S )zGet text of XML node� c S s g | ]}|j �qS � )� nodeValue)�.0�nr r �*/usr/lib/python3/dist-packages/xdg/Mime.py� <listcomp>/ s z"_get_node_data.<locals>.<listcomp>)�join� childNodes�strip)�noder r r �_get_node_data- s r c C s t | |�S )z�Get the MIMEtype object for the given type. This remains for backwards compatibility; calling MIMEtype now does the same thing. The name can either be passed as one part ('text/plain'), or as two ('text', 'plain'). )�MIMEtype��media�subtyper r r �lookup1 s r c sb e Zd ZdZd� fdd� Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� Zdd� Z� Z S )r z�Class holding data about a MIME type. Calling the class will return a cached instance, so there is only one instance for each MIME type. The name can either be passed as one part ('text/plain'), or as two ('text', 'plain'). Nc s� |d u rd|v r|� dd�\}}d|vsJ �|�� }|�� }zt||f W S tyD tt| ��| �}|�||� |t||f<