File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,13 @@ def file_extension(self):
42
42
containing data from this printer'''
43
43
return 'csv'
44
44
45
+ def escape (self , word ):
46
+ '''returns an escaped version of the value'''
47
+ if type (word ) == str and word .find (',' ) >= 0 :
48
+ return '"' + word .replace ('"' , '\\ "' ) + '"'
49
+ else :
50
+ return word
51
+
45
52
def scratch_table_header (self ):
46
53
'''Returns the header of the printout for scratch results'''
47
54
return 'Place,' + ',' .join (self .fields ) + '\n '
Original file line number Diff line number Diff line change @@ -73,9 +73,13 @@ def cat_table_footer(self, category):
73
73
@type category: string
74
74
@param category: name of the category handled by the table'''
75
75
return ''
76
-
76
+
77
+ def escape (self , word ):
78
+ '''returns an escaped version of the value, if needed'''
79
+ return word
80
+
77
81
def common_entry (self , row ):
78
- return self .row_delim .join (row )
82
+ return self .row_delim .join (map ( self . escape , row ) )
79
83
80
84
def scratch_entry (self , row , category = None ):
81
85
'''Returns the printout of the entry of a given runner
You can’t perform that action at this time.
0 commit comments