Replace map with list comprehensions

svn: r10848
This commit is contained in:
Gerald Britton 2008-07-09 14:39:10 +00:00
parent 4afaea5c72
commit 02484820e2

View File

@ -32,7 +32,6 @@
import time
from gettext import gettext as _
import csv
import string
import codecs
import cStringIO
@ -329,11 +328,8 @@ class CSVParser:
except:
pass
return None
data = []
try:
for row in reader:
row = map(string.strip, row)
data.append( row )
data = [[r.strip() for r in row] for row in reader]
except csv.Error, e:
ErrorDialog(_('format error: file %s, line %d: %s') %
(self.filename, reader.line_num, e))
@ -409,7 +405,7 @@ class CSVParser:
continue
######################################
if header is None:
header = map(cleanup_column_name, row)
header = [cleanup_column_name(r) for r in row]
col = {}
count = 0
for key in header: