From: Guido van Rossum Date: Fri, 4 Oct 1996 20:14:02 +0000 (+0000) Subject: Added getparamnames() to Message class -- return a list of all X-Git-Tag: v1.4~148 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4be63d17255b590bad8d80b564a717995f2ee3f3;p=thirdparty%2FPython%2Fcpython.git Added getparamnames() to Message class -- return a list of all parameters of the content-type header. --- diff --git a/Lib/mimetools.py b/Lib/mimetools.py index baf9379f537a..eadc11a5eab5 100644 --- a/Lib/mimetools.py +++ b/Lib/mimetools.py @@ -67,6 +67,14 @@ class Message(rfc822.Message): return rfc822.unquote(p[n:]) return None + def getparamnames(self): + result = [] + for p in self.plist: + i = string.find(p, '=') + if i >= 0: + result.append(string.lower(p[:i])) + return result + def getencoding(self): if self.encodingheader == None: return '7bit'