summaryrefslogtreecommitdiffstats
path: root/module/Utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/Utils.py')
-rw-r--r--module/Utils.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/module/Utils.py b/module/Utils.py
new file mode 100644
index 000000000..9cea1bab2
--- /dev/null
+++ b/module/Utils.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+
+""" Store all usefull functions here """
+
+import sys
+from os.path import join
+
+def save_join(*args):
+ """ joins a path, encoding aware """
+ paths = []
+ for path in args:
+ # remove : for win comp.
+ tmp = path.replace(":", "").encode(sys.getfilesystemencoding(), "replace")
+ paths.append(tmp)
+ return join(*paths)
+
+if __name__ == "__main__":
+ print save_join("test","/test2") \ No newline at end of file