[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35464] trunk/blender: when checking for windows check sys.platform starts with "win" rather then '== "win32"' & avoid importing platform.
Campbell Barton
ideasman42 at gmail.com
Fri Mar 11 02:24:17 CET 2011
Revision: 35464
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35464
Author: campbellbarton
Date: 2011-03-11 01:24:16 +0000 (Fri, 11 Mar 2011)
Log Message:
-----------
when checking for windows check sys.platform starts with "win" rather then '== "win32"' & avoid importing platform.
also add some notes to CMake options.
Modified Paths:
--------------
trunk/blender/CMakeLists.txt
trunk/blender/release/scripts/op/image.py
trunk/blender/release/scripts/op/screen_play_rendered_anim.py
trunk/blender/release/scripts/op/wm.py
trunk/blender/release/scripts/ui/space_info.py
Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt 2011-03-11 01:06:16 UTC (rev 35463)
+++ trunk/blender/CMakeLists.txt 2011-03-11 01:24:16 UTC (rev 35464)
@@ -67,12 +67,12 @@
get_blender_version()
# Blender internal features
-option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
-option(WITH_PYTHON "Enable Embedded Python API" ON)
-option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency)." OFF)
-option(WITH_PYTHON_MODULE "Enable building as a python module (experemental)" OFF)
-option(WITH_BUILDINFO "Include extra build details" ON)
-option(WITH_IK_ITASC "Enable ITASC IK solver" ON)
+option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
+option(WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON)
+option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
+option(WITH_PYTHON_MODULE "Enable building as a python module (experemental, only enable for development)" OFF)
+option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ON)
+option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
option(WITH_GAMEENGINE "Enable Game Engine" ON)
@@ -132,7 +132,7 @@
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
# Debug
-option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking" OFF)
+option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
mark_as_advanced(WITH_CXX_GUARDEDALLOC)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
Modified: trunk/blender/release/scripts/op/image.py
===================================================================
--- trunk/blender/release/scripts/op/image.py 2011-03-11 01:06:16 UTC (rev 35463)
+++ trunk/blender/release/scripts/op/image.py 2011-03-11 01:24:16 UTC (rev 35464)
@@ -31,25 +31,20 @@
filepath = StringProperty(name="File Path", description="Path to an image file", maxlen=1024, default="")
def _editor_guess(self, context):
- import platform
- try:
- system = platform.system()
- except UnicodeDecodeError:
- import sys
- system = sys.platform
+ import sys
image_editor = context.user_preferences.filepaths.image_editor
# use image editor in the preferences when available.
if not image_editor:
- if system in ('Windows', 'win32'):
+ if sys.platform[:3] == "win":
image_editor = ["start"] # not tested!
- elif system == 'Darwin':
+ elif sys.platform == "darwin":
image_editor = ["open"]
else:
image_editor = ["gimp"]
else:
- if system == 'Darwin':
+ if sys.platform == "darwin":
# blender file selector treats .app as a folder
# and will include a trailing backslash, so we strip it.
image_editor.rstrip('\\')
@@ -65,7 +60,7 @@
filepath = bpy.path.abspath(self.filepath)
if not os.path.exists(filepath):
- self.report('ERROR', "Image path '%s' not found." % filepath)
+ self.report('ERROR', "Image path %r not found." % filepath)
return {'CANCELLED'}
cmd = self._editor_guess(context) + [filepath]
Modified: trunk/blender/release/scripts/op/screen_play_rendered_anim.py
===================================================================
--- trunk/blender/release/scripts/op/screen_play_rendered_anim.py 2011-03-11 01:06:16 UTC (rev 35463)
+++ trunk/blender/release/scripts/op/screen_play_rendered_anim.py 2011-03-11 01:24:16 UTC (rev 35464)
@@ -29,19 +29,14 @@
def guess_player_path(preset):
- import platform
- try:
- system = platform.system()
- except UnicodeDecodeError:
- import sys
- system = sys.platform
+ import sys
if preset == 'BLENDER24':
player_path = "blender"
- if system == 'Darwin':
+ if sys.platform == "darwin":
test_path = "/Applications/blender 2.49.app/Contents/MacOS/blender"
- elif system in ('Windows', 'win32'):
+ elif sys.platform[:3] == "win":
test_path = "/Program Files/Blender Foundation/Blender/blender.exe"
if os.path.exists(test_path):
@@ -50,7 +45,8 @@
elif preset == 'DJV':
player_path = "djv_view"
- if system == 'Darwin':
+ if sys.platform == "darwin":
+ # TODO, crummy supporting only 1 version, could find the newest installed version
test_path = '/Applications/djv-0.8.2.app/Contents/Resources/bin/djv_view'
if os.path.exists(test_path):
player_path = test_path
Modified: trunk/blender/release/scripts/op/wm.py
===================================================================
--- trunk/blender/release/scripts/op/wm.py 2011-03-11 01:06:16 UTC (rev 35463)
+++ trunk/blender/release/scripts/op/wm.py 2011-03-11 01:24:16 UTC (rev 35464)
@@ -575,7 +575,7 @@
self.report({'ERROR'}, "File '%s' not found" % filepath)
return {'CANCELLED'}
- if sys.platform == 'win32':
+ if sys.platform[:3] == "win":
subprocess.Popen(['start', filepath], shell=True)
elif sys.platform == 'darwin':
subprocess.Popen(['open', filepath])
Modified: trunk/blender/release/scripts/ui/space_info.py
===================================================================
--- trunk/blender/release/scripts/ui/space_info.py 2011-03-11 01:06:16 UTC (rev 35463)
+++ trunk/blender/release/scripts/ui/space_info.py 2011-03-11 01:24:16 UTC (rev 35464)
@@ -364,7 +364,7 @@
layout.operator("help.operator_cheat_sheet", icon='TEXT')
layout.operator("wm.sysinfo", icon='TEXT')
layout.separator()
- if sys.platform == "win32":
+ if sys.platform[:3] == "win":
layout.operator("wm.toggle_console", icon='CONSOLE')
layout.separator()
layout.operator("anim.update_data_paths", text="FCurve/Driver 2.54 fix", icon='HELP')
More information about the Bf-blender-cvs
mailing list