summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Loeser <halcy0n@gentoo.org>2010-02-26 15:57:05 -0500
committerMark Loeser <halcy0n@gentoo.org>2010-02-26 15:57:05 -0500
commit71787e4a081392ba3e0cd16ffe656e5cdf5aeeb5 (patch)
treeff7810d56e3667e4354fd4c3d5a1ad585af03df5
parentHandle the '/' character in URLs while logging (diff)
downloadgard-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-xgard-v2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gard-v2.py b/gard-v2.py
index 76fecde..65ca06a 100755
--- a/gard-v2.py
+++ b/gard-v2.py
@@ -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":