summaryrefslogtreecommitdiff
path: root/Lib/mimetools.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-10-04 20:14:02 +0000
committerGuido van Rossum <guido@python.org>1996-10-04 20:14:02 +0000
commitfe601e594867d8d24087d2187bc8feeba2151885 (patch)
tree1a47090f6c6ee943aeb5835c1570de1e5aae8d20 /Lib/mimetools.py
parentfe5d0704bbbd1655155e68b63ccc00120889e102 (diff)
downloadcpython-fe601e594867d8d24087d2187bc8feeba2151885.tar.gz
Added getparamnames() to Message class -- return a list of all
parameters of the content-type header.
Diffstat (limited to 'Lib/mimetools.py')
-rw-r--r--Lib/mimetools.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/mimetools.py b/Lib/mimetools.py
index baf9379f53..eadc11a5ea 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'