Remove some lambdas.
This commit is contained in:
parent
a617271dbd
commit
f871d833dd
@ -34,6 +34,7 @@ __version__ = "2.6"
|
|||||||
# Imports
|
# Imports
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
from operator import attrgetter
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import urllib
|
import urllib
|
||||||
@ -331,7 +332,7 @@ def parse_header(line):
|
|||||||
Return the main content-type and a dictionary of options.
|
Return the main content-type and a dictionary of options.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
plist = map(lambda x: x.strip(), line.split(';'))
|
plist = [x.strip() for x in line.split(';')]
|
||||||
key = plist.pop(0).lower()
|
key = plist.pop(0).lower()
|
||||||
pdict = {}
|
pdict = {}
|
||||||
for p in plist:
|
for p in plist:
|
||||||
@ -570,7 +571,7 @@ class FieldStorage:
|
|||||||
if key in self:
|
if key in self:
|
||||||
value = self[key]
|
value = self[key]
|
||||||
if type(value) is type([]):
|
if type(value) is type([]):
|
||||||
return map(lambda v: v.value, value)
|
return map(attrgetter('value'), value)
|
||||||
else:
|
else:
|
||||||
return value.value
|
return value.value
|
||||||
else:
|
else:
|
||||||
@ -592,7 +593,7 @@ class FieldStorage:
|
|||||||
if key in self:
|
if key in self:
|
||||||
value = self[key]
|
value = self[key]
|
||||||
if type(value) is type([]):
|
if type(value) is type([]):
|
||||||
return map(lambda v: v.value, value)
|
return map(attrgetter('value'), value)
|
||||||
else:
|
else:
|
||||||
return [value.value]
|
return [value.value]
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user