diff options
Diffstat (limited to 'pyload/utils')
-rw-r--r-- | pyload/utils/PluginLoader.py | 2 | ||||
-rw-r--r-- | pyload/utils/fs.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/pyload/utils/PluginLoader.py b/pyload/utils/PluginLoader.py index cb1039443..57a899e39 100644 --- a/pyload/utils/PluginLoader.py +++ b/pyload/utils/PluginLoader.py @@ -182,6 +182,8 @@ class PluginLoader: # save number of of occurred stack = 0 endpos = m.start(2) - size + + #TODO: strings must be parsed too, otherwise breaks very easily for i in xrange(m.end(2), len(content) - size + 1): if content[i:i+size] == endchar: # closing char seen and match now complete diff --git a/pyload/utils/fs.py b/pyload/utils/fs.py index 05e098e2a..939adb87c 100644 --- a/pyload/utils/fs.py +++ b/pyload/utils/fs.py @@ -48,7 +48,7 @@ def makedirs(path, mode=0755): def listdir(path): return [fs_decode(x) for x in os.listdir(fs_encode(path))] -def save_filename(name): +def safe_filename(name): #remove some chars if os.name == 'nt': return remove_chars(name, '/\\?%*:|"<>,') @@ -58,10 +58,13 @@ def save_filename(name): def stat(name): return os.stat(fs_encode(name)) -def save_join(*args): +def safe_join(*args): """ joins a path, encoding aware """ return fs_encode(join(*[x if type(x) == unicode else decode(x) for x in args])) +def save_join(*args): + return safe_join(*args) + def free_space(folder): folder = fs_encode(folder) |