diff options
author | 2010-02-26 15:57:05 -0500 | |
---|---|---|
committer | 2010-02-26 15:57:05 -0500 | |
commit | 71787e4a081392ba3e0cd16ffe656e5cdf5aeeb5 (patch) | |
tree | ff7810d56e3667e4354fd4c3d5a1ad585af03df5 | |
parent | Handle the '/' character in URLs while logging (diff) | |
download | gard-71787e4a081392ba3e0cd16ffe656e5cdf5aeeb5.tar.gz gard-71787e4a081392ba3e0cd16ffe656e5cdf5aeeb5.tar.bz2 gard-71787e4a081392ba3e0cd16ffe656e5cdf5aeeb5.zip |
Use Python's CSV module to do the CSV parsing instead of trying to do it ourselves
-rwxr-xr-x | gard-v2.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -14,6 +14,7 @@ import datetime import subprocess import logging import urllib2 +import csv import check @@ -58,9 +59,8 @@ _.close() # Format of CSV = 234083,"2008-08-06 13:01:32","ASSIGNED",,"[rsync,distfiles|all] New mirror Cambrium BV (The Netherlands)","due:2008/09/01;dist:http://mirror.cambrium.nl/pub/os/linux/gentoo/|ftp://mirror.cambrium.nl/pub/os/linux/gentoo/|rsync://mirror.cambrium.nl/gentoo/;portage:mirror.cambrium.nl" -for line in file: - line=line.replace("\n","") - data=line.split(',') +reader = csv.reader(file, delimiter=',', quotechar='"') +for data in reader: bugnum=data[0] swboard=data[5] if bugnum == "bug_id": |