(self, name, params, value, group=None, encoded=False,
                 isNative=False, lineNumber=None, *args, **kwds)
Take output from parseLine, convert params list to dictionary.

        Group is used as a positional argument to match parseLine's return
Take output from parseLine, convert params list to dictionary.
Take output from parseLine convert params list to dictionary .
def __init__(self, name, params, value, group=None, encoded=False,
                 isNative=False, lineNumber=None, *args, **kwds):
        """
        Take output from parseLine, convert params list to dictionary.

        Group is used as a positional argument to match parseLine's return
        """
        super(ContentLine, self).__init__(group, *args, **kwds)

        self.name = name.upper()
        self.encoded = encoded
        self.params = {}
        self.singletonparams = []
        self.isNative = isNative
        self.lineNumber = lineNumber
        self.value = value

        def updateTable(x):
            if len(x) == 1:
                self.singletonparams += x
            else:
                paramlist = self.params.setdefault(x[0].upper(), [])
                paramlist.extend(x[1:])

        list(map(updateTable, params))

        qp = False
        if 'ENCODING' in self.params:
            if 'QUOTED-PRINTABLE' in self.params['ENCODING']:
                qp = True
                self.params['ENCODING'].remove('QUOTED-PRINTABLE')
                if len(self.params['ENCODING']) == 0:
                    del self.params['ENCODING']
        if 'QUOTED-PRINTABLE' in self.singletonparams:
            qp = True
            self.singletonparams.remove('QUOTED-PRINTABLE')
        if qp:
            if 'ENCODING' in self.params:
                self.value = codecs.decode(self.value.encode("utf-8"), "quoted-printable").decode(self.params['ENCODING'])
            else:
                if 'CHARSET' in self.params:
                    self.value = codecs.decode(self.value.encode("utf-8"), "quoted-printable").decode(self.params['CHARSET'][0])
                else:
                    self.value = codecs.decode(self.value.encode("utf-8"), "quoted-printable").decode('utf-8')
def __init__ ( self , name , params , value , group = None , encoded = False , isNative = False , lineNumber = None , * args , * * kwds ) : super ( ContentLine , self ) . __init__ ( group , * args , * * kwds ) self . name = name . upper ( ) self . encoded = encoded self . params = { } self . singletonparams = [ ] self . isNative = isNative self . lineNumber = lineNumber self . value = value def updateTable ( x ) : if len ( x ) == 1 : self . singletonparams += x else : paramlist = self . params . setdefault ( x [ 0 ] . upper ( ) , [ ] ) paramlist . extend ( x [ 1 : ] ) list ( map ( updateTable , params ) ) qp = False if 'ENCODING' in self . params : if 'QUOTED-PRINTABLE' in self . params [ 'ENCODING' ] : qp = True self . params [ 'ENCODING' ] . remove ( 'QUOTED-PRINTABLE' ) if len ( self . params [ 'ENCODING' ] ) == 0 : del self . params [ 'ENCODING' ] if 'QUOTED-PRINTABLE' in self . singletonparams : qp = True self . singletonparams . remove ( 'QUOTED-PRINTABLE' ) if qp : if 'ENCODING' in self . params : self . value = codecs . decode ( self . value . encode ( "utf-8" ) , "quoted-printable" ) . decode ( self . params [ 'ENCODING' ] ) else : if 'CHARSET' in self . params : self . value = codecs . decode ( self . value . encode ( "utf-8" ) , "quoted-printable" ) . decode ( self . params [ 'CHARSET' ] [ 0 ] ) else : self . value = codecs . decode ( self . value . encode ( "utf-8" ) , "quoted-printable" ) . decode ( 'utf-8' )