summaryrefslogtreecommitdiffstats
path: root/core/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/utils.py')
-rw-r--r--core/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/utils.py b/core/utils.py
index 9144113..17bd953 100644
--- a/core/utils.py
+++ b/core/utils.py
@@ -44,6 +44,11 @@ except:
pass
+def sanitize_name(name):
+ """Filenames sould not caontain these characters as then the system barf when it tries to use them in URLs
+ """
+ return name.replace("#","-").replace("?","=").replace("&","+").replace(":","^")
+
def get_process_memory():
usage = resource.getrusage(resource.RUSAGE_SELF)
return usage[2] / 1024.0