1 |
# Copyright (c) 2001 by Intevation GmbH |
# Copyright (c) 2001, 2002 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
4 |
# |
# |
77 |
# for that to faciliate testing |
# for that to faciliate testing |
78 |
import posixpath |
import posixpath |
79 |
if not posixpath.isabs(absname): |
if not posixpath.isabs(absname): |
80 |
return absname |
return absname |
81 |
|
|
82 |
if not posixpath.isabs(dir): |
if not posixpath.isabs(dir): |
83 |
raise TypeError("first argument must be an absolute filename") |
raise TypeError("first argument must be an absolute filename") |
138 |
|
|
139 |
# handle some special cases |
# handle some special cases |
140 |
if not ntpath.isabs(absname_rest): |
if not ntpath.isabs(absname_rest): |
141 |
return absname |
return absname |
142 |
|
|
143 |
if dir_drive != absname_drive: |
if dir_drive != absname_drive: |
144 |
return absname |
return absname |
149 |
return relative_filename_common(dir_rest, absname_rest, "\\") |
return relative_filename_common(dir_rest, absname_rest, "\\") |
150 |
|
|
151 |
|
|
152 |
# bind the appriate version of relative_filename for the platform we're |
# bind the appropriate version of relative_filename for the platform |
153 |
# currently running on. |
# we're currently running on. |
154 |
if os.name == "posix": |
if os.name == "posix": |
155 |
relative_filename = relative_filename_posix |
relative_filename = relative_filename_posix |
156 |
elif os.name == "nt": |
elif os.name == "nt": |