From 65c01483993750b365cb5ae19ecb4ce339565575 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 1 Jan 2011 13:40:51 +0100 Subject: closed #200 --- module/Utils.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 module/Utils.py (limited to 'module/Utils.py') 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 -- cgit v1.2.3