CRLF ending for csv

main
Bob Mottram 2021-07-28 10:52:13 +01:00
parent 9130e5ce61
commit 9711818da9
1 changed files with 2 additions and 2 deletions

View File

@ -963,7 +963,7 @@ def sharesCatalogCSVEndpoint(baseDir: str, httpPrefix: str,
return '' return ''
csvStr = \ csvStr = \
'id,type,hasType,startDate,expiryDate,' + \ 'id,type,hasType,startDate,expiryDate,' + \
'quantity,price,Image,description\n' 'quantity,price,Image,description\r\n'
for item in catalogJson['DFC:supplies']: for item in catalogJson['DFC:supplies']:
csvStr += '"' + item['@id'] + '",' csvStr += '"' + item['@id'] + '",'
csvStr += '"' + item['@type'] + '",' csvStr += '"' + item['@type'] + '",'
@ -974,7 +974,7 @@ def sharesCatalogCSVEndpoint(baseDir: str, httpPrefix: str,
csvStr += item['DFC:price'] + ',' csvStr += item['DFC:price'] + ','
csvStr += '"' + item['DFC:Image'] + '",' csvStr += '"' + item['DFC:Image'] + '",'
description = item['DFC:description'].replace('"', "'") description = item['DFC:description'].replace('"', "'")
csvStr += '"' + description + '"\n' csvStr += '"' + description + '",\r\n'
return csvStr return csvStr