Start using csv.writer to handle report output.

This allows us to stop using '' where we mean None at several places in
the code, since the csv.writer will translate it for us properly.

Change-Id: I075c5fa2e1ad2d5d263095c4312bed4af309ff6d
diff --git a/wifitables/report.py b/wifitables/report.py
index 9ea993b..8ee0fac 100755
--- a/wifitables/report.py
+++ b/wifitables/report.py
@@ -256,14 +256,14 @@
       width = int(m.group(1))
 
     # Noise and contention not yet gathered in samples run on Linux systems.
-    line += [channel, width, signal, '', '', '']
+    line += [channel, width, signal, None, None, None]
 
   mpath = os.path.join(report_dir, 'mcs')
   if os.path.isfile(mpath):
     with open(os.path.join(report_dir, 'mcs')) as mf:
       line += ParseMCSFile(mf, width)
   else:
-    line += ['', '']
+    line += [None, None]
 
   # If the initial ping test fails, we won't collect performance information.
   # deal with this gracefully.
@@ -306,11 +306,12 @@
     o.fatal("didn't find any samples. did you supply at least one report dir"
             ' or journal?')
 
-  print '\t'.join(['Steps', 'Channel', 'Width', 'RSSI', 'Noise', 'Shared',
-                   'Interfering', 'MCS', 'PHY', 'TCP BW', '(Units)', 'UDP BW',
-                   '(Units)'])
-  for line in lines:
-    print '\t'.join(str(i) for i in line)
+  header = ['Steps', 'Channel', 'Width', 'RSSI', 'Noise', 'Shared',
+            'Interfering', 'MCS', 'PHY', 'TCP BW', '(Units)', 'UDP BW',
+            '(Units)']
+  writer = csv.writer(sys.stdout, delimiter='\t', quoting=csv.QUOTE_MINIMAL)
+  writer.writerow(header)
+  writer.writerows(lines)
 
 
 if __name__ == '__main__':