fnp
/
edumed.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
fixes in the cybernauci form
[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)