]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added getparamnames() to Message class -- return a list of all
authorGuido van Rossum <guido@python.org>
Fri, 4 Oct 1996 20:14:02 +0000 (20:14 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 4 Oct 1996 20:14:02 +0000 (20:14 +0000)
parameters of the content-type header.

Lib/mimetools.py

index baf9379f537a52eba04713ee6aaea76f84b738ed..eadc11a5eab56479212fb4c528d1dc35cb5c3b64 100644 (file)
@@ -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'