[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/metacode mputils.py
From: |
Asko Soukka |
Subject: |
[Gzz-commits] gzz/metacode mputils.py |
Date: |
Mon, 10 Feb 2003 09:32:45 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Asko Soukka <address@hidden> 03/02/10 09:32:44
Modified files:
metacode : mputils.py
Log message:
getting rid of buggy docutils.utils.relative_path ;)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/mputils.py.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
Patches:
Index: gzz/metacode/mputils.py
diff -u gzz/metacode/mputils.py:1.14 gzz/metacode/mputils.py:1.15
--- gzz/metacode/mputils.py:1.14 Mon Feb 10 09:07:43 2003
+++ gzz/metacode/mputils.py Mon Feb 10 09:32:44 2003
@@ -86,22 +86,21 @@
def transition_path(from_path, to_path):
"""
- The current implementation sucks, so why wouldn't use
- something ready and working :)
+ Returns the transition path from from_path to to_path.
"""
- from_path = os.path.normpath(os.path.abspath(from_path))
- to_path = os.path.normpath(os.path.abspath(to_path))
+
+## Tried to use docutils.utils.relative_path instead of this, but
+## it crashed with Jython :( e.g. relative_path("", "") raised a
+## java.lang.NegativeArraySizeException
+
# print "from:", from_path, "to:", to_path+"/foo"
-# terrible kludge to avoid java.lang.NegativeArraySizeException with Jython
- transition = docutils.utils.relative_path(from_path+"/foo", to_path)
- if transition.startswith("../"):
- transition = transition[3:len(transition)]
+# transition = docutils.utils.relative_path(from_path, to_path)
# print "transition:", transition
- return transition
+# return transition
- """
- Returns the transition path from from_path to to_path.
- """
+
+ from_path = os.path.normpath(os.path.abspath(from_path))
+ to_path = os.path.normpath(os.path.abspath(to_path))
depth = from_path.count("/")
from_parts = from_path.split("/")
to_parts = to_path.split("/")