56 |
Returns a relative path from the source to the target. |
Returns a relative path from the source to the target. |
57 |
""" |
""" |
58 |
if source == None or len(source) == 0: return target |
if source == None or len(source) == 0: return target |
59 |
if source.startswith('../') or target.startswith('../'): |
|
60 |
source = os.path.normpath(os.path.abspath(source)) |
## Condition removed because because of docutils sending |
61 |
target = os.path.normpath(os.path.abspath(target)) |
# relative and absolute paths mixed. |
62 |
|
# |
63 |
|
# if source.startswith('../') or target.startswith('../'): |
64 |
|
source = os.path.normpath(os.path.abspath(source)) |
65 |
|
target = os.path.normpath(os.path.abspath(target)) |
66 |
|
|
67 |
depth = source.count('/') |
depth = source.count('/') |
68 |
source_parts = source.split('/') |
source_parts = source.split('/') |