fnp
/
edumed.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
supplement question
[edumed.git]
/
contact
/
utils.py
1
def csv_escape(string):
2
return '"' + string.replace('\r\n', ' ').replace('\n', ' ').replace('"', '\"') + '"'
3
4
def csv_prepare(obj):
5
to_escape = obj
6
if not isinstance(obj, unicode):
7
to_escape = str(to_escape)
8
return csv_escape(to_escape)