diff options
author | 2015-04-18 14:08:18 +0200 | |
---|---|---|
committer | 2015-04-18 14:08:18 +0200 | |
commit | 6e8f84e1dc06cff6fa9387559992f555182c1774 (patch) | |
tree | 476600f9896fae029880e4049eb4c5e6021b202d /pyload/webui/filters.py | |
parent | fix: config cast (diff) | |
parent | Spare code cosmetics (5) (diff) | |
download | pyload-6e8f84e1dc06cff6fa9387559992f555182c1774.tar.xz |
Merge pull request #3 from vuolter/0.4.10
merge vuolter HEAD
Diffstat (limited to 'pyload/webui/filters.py')
-rw-r--r-- | pyload/webui/filters.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pyload/webui/filters.py b/pyload/webui/filters.py index c784b248d..ea4b159fa 100644 --- a/pyload/webui/filters.py +++ b/pyload/webui/filters.py @@ -18,7 +18,7 @@ except Exception: path_list = abspath(path).split(sep) # Work out how much of the filepath is shared by start and path. i = len(commonprefix([start_list, path_list])) - rel_list = [pardir] * (len(start_list)-i) + path_list[i:] + rel_list = [pardir] * (len(start_list) - i) + path_list[i:] if not rel_list: return curdir return join(*rel_list) @@ -32,6 +32,7 @@ def quotepath(path): except Exception: return "" + def unquotepath(path): try: return path.replace(quotechar, "../") @@ -40,6 +41,7 @@ def unquotepath(path): except Exception: return "" + def path_make_absolute(path): p = os.path.abspath(path) if p[-1] == os.path.sep: @@ -47,6 +49,7 @@ def path_make_absolute(path): else: return p + os.path.sep + def path_make_relative(path): p = relpath(path) if p[-1] == os.path.sep: @@ -54,10 +57,12 @@ def path_make_relative(path): else: return p + os.path.sep + def truncate(value, n): if (n - len(value)) < 3: - return value[:n]+"..." + return value[:n] + "..." return value + def date(date, format): return date |