diff options
author | 2015-05-12 02:00:28 +0200 | |
---|---|---|
committer | 2015-05-12 03:22:29 +0200 | |
commit | 0349b81a10d2937897f30031c4dedb49aa132d8c (patch) | |
tree | 3db2827cd64888cc013e064d4e201b8a6ddbc7a9 /pyload/webui/filters.py | |
parent | Merge pull request #12 from GammaC0de/GammaC0de-fix-api (diff) | |
download | pyload-0349b81a10d2937897f30031c4dedb49aa132d8c.tar.xz |
'from os' -> 'import os' and so on...
Diffstat (limited to 'pyload/webui/filters.py')
-rw-r--r-- | pyload/webui/filters.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/pyload/webui/filters.py b/pyload/webui/filters.py index e11944c94..9d4d47c04 100644 --- a/pyload/webui/filters.py +++ b/pyload/webui/filters.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import os -from os.path import abspath, commonprefix, join quotechar = "::/" @@ -11,18 +10,18 @@ except Exception: from posixpath import curdir, sep, pardir - def relpath(path, start=curdir): + def os.relpath(path, start=curdir): """Return a relative version of a path""" if not path: raise ValueError("no path specified") - start_list = abspath(start).split(sep) - path_list = abspath(path).split(sep) + start_list = os.path.abspath(start).split(sep) + path_list = os.path.abspath(path).split(sep) # Work out how much of the filepath is shared by start and path. - i = len(commonprefix([start_list, path_list])) + i = len(os.path.commonprefix([start_list, path_list])) rel_list = [pardir] * (len(start_list) - i) + path_list[i:] if not rel_list: return curdir - return join(*rel_list) + return os.path.join(*rel_list) def quotepath(path): @@ -52,7 +51,7 @@ def path_make_absolute(path): def path_make_relative(path): - p = relpath(path) + p = os.relpath(path) if p[-1] == os.path.sep: return p else: |