diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-01-01 13:40:51 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-01-01 13:40:51 +0100 |
commit | 65c01483993750b365cb5ae19ecb4ce339565575 (patch) | |
tree | 9d5380abf465c2861958ba1a77c2bbd4b7cebe6f /module/Utils.py | |
parent | Happy new Year !!! (diff) | |
download | pyload-65c01483993750b365cb5ae19ecb4ce339565575.tar.xz |
closed #200
Diffstat (limited to 'module/Utils.py')
-rw-r--r-- | module/Utils.py | 18 |
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 |