(path)
return mtype
Return the mime type of the file on a local filesystem.

    In case the path is a compressed file return the mime type of its contents

    Parameters
    ----------
    path : str
        Local filesystem path

    Returns
    -------
    mimetype: QMimeType
Return the mime type of the file on a local filesystem.
Return the mime type of the file on a local filesystem .
def _mime_type_for_path(path):
    # type: (str) -> QMimeType
    """
    Return the mime type of the file on a local filesystem.

    In case the path is a compressed file return the mime type of its contents

    Parameters
    ----------
    path : str
        Local filesystem path

    Returns
    -------
    mimetype: QMimeType
    """
    db = QMimeDatabase()
    mtype = db.mimeTypeForFile(path, QMimeDatabase.MatchDefault)
    if any(mtype.inherits(t) for t in compression_types):
        # peek contents
        try:
            with _open(path, "rb") as f:
                sample = f.read(4096)
        except Exception:  # pylint: disable=broad-except
            sample = b''
        mtype = db.mimeTypeForData(sample)
    return mtype
def _mime_type_for_path ( path ) : # type: (str) -> QMimeType db = QMimeDatabase ( ) mtype = db . mimeTypeForFile ( path , QMimeDatabase . MatchDefault ) if any ( mtype . inherits ( t ) for t in compression_types ) : # peek contents try : with _open ( path , "rb" ) as f : sample = f . read ( 4096 ) except Exception : # pylint: disable=broad-except sample = b'' mtype = db . mimeTypeForData ( sample ) return mtype