def parse(cls, mimetype):
        """
        Extracts the full type and parameters from the given MimeType.
        :param str mimetype: The mimetype to be parsed.
        :return: Returns a tuple with full type and parameters.
        """
        plist = mimetype.split(';')

        main_type, _, sub_type = plist.pop(0).lower().strip().partition('/')
        params = {}

        for p in plist:
            kv = p.split('=')
            if len(kv) != 2:
                continue
            v = kv[1].strip()
            if v:
                params[kv[0].strip()] = v

        return MimeType(main_type, sub_type, params)
def parse ( cls , mimetype ) : plist = mimetype . split ( ';' ) main_type , _ , sub_type = plist . pop ( 0 ) . lower ( ) . strip ( ) . partition ( '/' ) params = { } for p in plist : kv = p . split ( '=' ) if len ( kv ) != 2 : continue v = kv [ 1 ] . strip ( ) if v : params [ kv [ 0 ] . strip ( ) ] = v return MimeType ( main_type , sub_type , params )
Extracts the full type and parameters from the given MimeType.
        :param str mimetype: The mimetype to be parsed.
        :return: Returns a tuple with full type and parameters.