diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
commit | 49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch) | |
tree | 5410cb9a8fd53168bb60d62c54b654d86f03c38d /Tools/Scripts/webkitpy/common/system/path.py | |
parent | b211c645d8ab690f713515dfdc84d80b11c27d2c (diff) | |
download | qtwebkit-49233e234e5c787396cadb2cea33b31ae0cd65c1.tar.gz |
Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813)
New snapshot with Windows build fixes
Diffstat (limited to 'Tools/Scripts/webkitpy/common/system/path.py')
-rw-r--r-- | Tools/Scripts/webkitpy/common/system/path.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Tools/Scripts/webkitpy/common/system/path.py b/Tools/Scripts/webkitpy/common/system/path.py index b7ad3723a..e5a66bf87 100644 --- a/Tools/Scripts/webkitpy/common/system/path.py +++ b/Tools/Scripts/webkitpy/common/system/path.py @@ -35,11 +35,9 @@ import threading import urllib -def abspath_to_uri(path, platform=None): +def abspath_to_uri(platform, path): """Converts a platform-specific absolute path to a file: URL.""" - if platform is None: - platform = sys.platform - return "file:" + _escape(_convert_path(path, platform)) + return "file:" + _escape(_convert_path(platform, path)) def cygpath(path): @@ -118,12 +116,12 @@ def _escape(path): return urllib.quote(path, safe='/+:') -def _convert_path(path, platform): +def _convert_path(platform, path): """Handles any os-specific path separators, mappings, etc.""" - if platform == 'win32': - return _winpath_to_uri(path) - if platform == 'cygwin': + if platform.is_cygwin(): return _winpath_to_uri(cygpath(path)) + if platform.is_win(): + return _winpath_to_uri(path) return _unixypath_to_uri(path) |