diff options
author | Ian Bicking <ian@ianbicking.org> | 2005-08-22 23:29:31 +0000 |
---|---|---|
committer | Ian Bicking <ian@ianbicking.org> | 2005-08-22 23:29:31 +0000 |
commit | 82d331036f311709b77a1e3a90a9b191c9e49c61 (patch) | |
tree | 2c91bcd0181be8babe4146c3f448429e4840f29f /paste/webkit/FakeWebware/MiscUtils/CSVJoiner.py | |
parent | 36d1c63f5e12f1dfd6d5187359093a96a2fd2de4 (diff) | |
download | paste-git-82d331036f311709b77a1e3a90a9b191c9e49c61.tar.gz |
Moved webkit to separate project
Diffstat (limited to 'paste/webkit/FakeWebware/MiscUtils/CSVJoiner.py')
-rw-r--r-- | paste/webkit/FakeWebware/MiscUtils/CSVJoiner.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/paste/webkit/FakeWebware/MiscUtils/CSVJoiner.py b/paste/webkit/FakeWebware/MiscUtils/CSVJoiner.py deleted file mode 100644 index 2bc13a9..0000000 --- a/paste/webkit/FakeWebware/MiscUtils/CSVJoiner.py +++ /dev/null @@ -1,21 +0,0 @@ -import types - - -def joinCSVFields(fields): - """ - Returns a CSV record (eg a string) from a sequence of fields. - Fields containing commands (,) or double quotes (") are quotes - and double quotes are escaped (""). The terminating newline is - NOT included. - """ - newFields = [] - for field in fields: - assert type(field) is types.StringType - if field.find('"')!=-1: - newField = '"' + field.replace('"', '""') + '"' - elif field.find(',')!=-1 or field.find('\n')!=-1 or field.find('\r')!=-1: - newField = '"' + field + '"' - else: - newField = field - newFields.append(newField) - return ','.join(newFields) |