fnp
/
edumed.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
bba8c34dbbeac3323a370cf8912dc37510fd4e51
[edumed.git]
/
contact
/
utils.py
1
# -*- coding: utf-8 -*-
2
3
4
def csv_escape(string):
5
return '"' + string.replace('\r\n', ' ').replace('\n', ' ').replace('"', '\"') + '"'
6
7
8
def csv_prepare(obj):
9
to_escape = obj
10
if not isinstance(obj, unicode):
11
to_escape = str(to_escape)
12
return csv_escape(to_escape)