2249 protocol, url = url.split("://") |
2249 protocol, url = url.split("://") |
2250 if url.startswith("\\\\"): |
2250 if url.startswith("\\\\"): |
2251 url = url[2:] |
2251 url = url[2:] |
2252 if protocol == "file": |
2252 if protocol == "file": |
2253 url = os.path.normcase(url) |
2253 url = os.path.normcase(url) |
|
2254 if url[1] == ":": |
|
2255 url = url.replace(":", "|", 1) |
2254 url = url.replace('\\', '/') |
2256 url = url.replace('\\', '/') |
2255 if url.endswith('/'): |
2257 if url.endswith('/'): |
2256 url = url[:-1] |
2258 url = url[:-1] |
2257 if not url.startswith("/") and url[1] in [":", "|"]: |
2259 if not url.startswith("/") and url[1] in [":", "|"]: |
2258 url = "/{0}".format(url) |
2260 url = "/{0}".format(url) |