commit aba60175b6e294f6ee18cd9be14189d6c62e7b00
parent c74a05c35364e882f0cc8b86d4d527c56363bb09
Author: Daniel Moch <daniel@danielmoch.com>
Date: Fri, 2 Mar 2018 05:36:55 -0500
Remove trailing commas from CSV
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/schedule.py b/schedule.py
@@ -62,15 +62,13 @@ def _csv_export(self, outfile):
outfile.write('\n')
for entry in self.data:
outfile.write('"' + entry['day_of_week'] + ', ' + \
- entry['month'] + ' ' + str(entry['day']) + '"' \
- + ',')
+ entry['month'] + ' ' + str(entry['day']) + '"')
for column in self._column_section_mapping.keys():
for reading in entry['readings']:
if reading['section'] in \
self._column_section_mapping[column]:
- outfile.write('"' + reading['book'] + ' ' + \
+ outfile.write(',"' + reading['book'] + ' ' + \
reading['reading'] + '"')
- outfile.write(",")
outfile.write('\n')
def export(self):