Fix platform detection on OSX

'darwin' is returned by sys.platform, not os.name.

svn: r21180
This commit is contained in:
John Ralls 2013-01-20 19:35:35 +00:00
parent c4802bd210
commit 2f77462320
3 changed files with 7 additions and 6 deletions

View File

@ -52,11 +52,11 @@ SPHINXBUILD = 'sphinx-build'
if sys.platform == 'win32':
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
elif sys.platform == 'linux2' or os.name == 'darwin':
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
sphinxCmd = SPHINXBUILD
else:
print ("ERROR: unknown system, don't know sphinx, ... commands")
print ("Update Man ERROR: unknown system, don't know sphinx, ... commands")
sys.exit(0)
def tests():

View File

@ -42,11 +42,11 @@ SPHINXBUILD = 'sphinx-build'
if sys.platform == 'win32':
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
elif sys.platform == 'linux2' or os.name == 'darwin':
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
sphinxCmd = SPHINXBUILD
else:
print ("ERROR: unknown system, don't know sphinx, ... commands")
print ("Update Docs ERROR: unknown system, don't know sphinx, ... commands")
sys.exit(0)
def tests():

View File

@ -65,14 +65,15 @@ if sys.platform == 'win32':
# Others OS
elif sys.platform == 'linux2' or os.name == 'darwin':
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
msgmergeCmd = 'msgmerge'
msgfmtCmd = 'msgfmt'
msgattribCmd = 'msgattrib'
xgettextCmd = 'xgettext'
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
else:
print ("ERROR: unknown system, don't know msgmerge, ... commands")
print("Found platform %s, OS %s" % (sys.platform, os.name))
print ("Update PO ERROR: unknown system, don't know msgmerge, ... commands")
sys.exit(0)
# List of available languages, useful for grouped actions