From: W. Trevor King Date: Fri, 8 Mar 2013 19:19:19 +0000 (-0500) Subject: swc-installation-test-2.py: Use _ROOT_PATH for MS Windows compatability X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e4d11998c6f1caae8c769f6e4c1b64b84822daac;p=swc-workshop.git swc-installation-test-2.py: Use _ROOT_PATH for MS Windows compatability I don't think starting a path with os.sep gives you a root path on Windows. We need the backslash in _ROOT_PATH, because: os.path.join('c:', 'foo') gives 'c:foo', a path relative to the current directory on drive C: [1]. [1]: http://docs.python.org/3/library/os.path.html#os.path.join --- diff --git a/setup/swc-installation-test-2.py b/setup/swc-installation-test-2.py index ded36f6..38c81a9 100755 --- a/setup/swc-installation-test-2.py +++ b/setup/swc-installation-test-2.py @@ -101,6 +101,10 @@ CHECKS = [ CHECKER = {} +_ROOT_PATH = _os.sep +if _platform.system() == 'win32': + _ROOT_PATH = 'c:\\' + class InvalidCheck (KeyError): def __init__(self, check): @@ -578,16 +582,16 @@ class PathCommandDependency (CommandDependency): for paths,name,long_name in [ - ([_os.path.join(_os.sep, 'Applications', 'Sublime Text 2.app')], + ([_os.path.join(_ROOT_PATH, 'Applications', 'Sublime Text 2.app')], 'sublime-text', 'Sublime Text'), - ([_os.path.join(_os.sep, 'Applications', 'TextMate.app')], + ([_os.path.join(_ROOT_PATH, 'Applications', 'TextMate.app')], 'textmate', 'TextMate'), - ([_os.path.join(_os.sep, 'Applications', 'TextWrangler.app')], + ([_os.path.join(_ROOT_PATH, 'Applications', 'TextWrangler.app')], 'textwrangler', 'TextWrangler'), - ([_os.path.join(_os.sep, 'Applications', 'Safari.app')], + ([_os.path.join(_ROOT_PATH, 'Applications', 'Safari.app')], 'safari', 'Safari'), - ([_os.path.join(_os.sep, 'Applications', 'Xcode.app'), # OS X >=1.7 - _os.path.join(_os.sep, 'Developer', 'Applications', 'Xcode.app' + ([_os.path.join(_ROOT_PATH, 'Applications', 'Xcode.app'), # OS X >=1.7 + _os.path.join(_ROOT_PATH, 'Developer', 'Applications', 'Xcode.app' ) # OS X 1.6, ], 'xcode', 'Xcode'),