summaryrefslogtreecommitdiffstats
path: root/module/web/pyload/views.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-11-27 00:20:04 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-11-27 00:20:04 +0100
commitba9dcb559c91d7bf44a5f79da42d963dfb21e85d (patch)
treefc3d13824958a1bee9cf015bc63436e7b2dacb8b /module/web/pyload/views.py
parentpath browser encoding fix (diff)
downloadpyload-ba9dcb559c91d7bf44a5f79da42d963dfb21e85d.tar.xz
relpath for 2.5
Diffstat (limited to 'module/web/pyload/views.py')
-rw-r--r--module/web/pyload/views.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py
index 40d3b8207..62c405339 100644
--- a/module/web/pyload/views.py
+++ b/module/web/pyload/views.py
@@ -17,6 +17,11 @@ from copy import deepcopy
from operator import itemgetter
from pyload.templatetags import quotepath
+try:
+ from os.path import relpath
+except:
+ from pyload.templatetags import relpath
+
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
@@ -405,7 +410,7 @@ def path(request, path, type):
cwd = os.path.abspath(path)
abs = True
else:
- cwd = os.path.relpath(path)
+ cwd = relpath(path)
else:
cwd = os.getcwd()
@@ -418,10 +423,10 @@ def path(request, path, type):
parentdir = os.path.dirname(cwd)
if not abs:
if os.path.abspath(cwd) == "/":
- cwd = os.path.relpath(cwd)
+ cwd = relpath(cwd)
else:
- cwd = os.path.relpath(cwd) + os.path.sep
- parentdir = os.path.relpath(parentdir) + os.path.sep
+ cwd = relpath(cwd) + os.path.sep
+ parentdir = relpath(parentdir) + os.path.sep
if os.path.abspath(cwd) == "/":
parentdir = ""