diff options
author | Eric Messick <ericm@nanorex.com> | 2008-03-14 21:49:42 +0000 |
---|---|---|
committer | Eric Messick <ericm@nanorex.com> | 2008-03-14 21:49:42 +0000 |
commit | 0a3a84ae98b5ec22549edcea676d3cebb8fd2e8f (patch) | |
tree | f5361eb32ef256c633ca008fdd3dd0abedfa19ff | |
parent | 47e42b03d086adcbbf72c2ed71b11818d63fcd93 (diff) | |
download | nanoengineer-theirix-0a3a84ae98b5ec22549edcea676d3cebb8fd2e8f.tar.gz nanoengineer-theirix-0a3a84ae98b5ec22549edcea676d3cebb8fd2e8f.zip |
moved get_default_plugin_path to platform.Paths
-rwxr-xr-x | cad/src/graphics/rendering/povray/povray.py | 19 | ||||
-rwxr-xr-x | cad/src/ne1_ui/UserPrefs.py | 2 | ||||
-rw-r--r-- | cad/src/platform/Paths.py | 28 |
3 files changed, 29 insertions, 20 deletions
diff --git a/cad/src/graphics/rendering/povray/povray.py b/cad/src/graphics/rendering/povray/povray.py index e833386d2..3960d901d 100755 --- a/cad/src/graphics/rendering/povray/povray.py +++ b/cad/src/graphics/rendering/povray/povray.py @@ -404,23 +404,4 @@ def verify_povray_program(): # not yet used, not yet correctly implemented # == -# This should probably be moved to somewhere else like Plugins.py -# Talk to Bruce about pros/cons of this. Mark 060529. -def get_default_plugin_path(win32_path, darwin_path, linux_path): - """ - Returns the plugin (executable) path to the standard location for each platform - (taken from the appropriate one of the three platform-specific arguments), - but only if a file or dir exists there. - Otherwise, returns an empty string. - """ - if sys.platform == "win32": # Windows - plugin_path = win32_path - elif sys.platform == "darwin": # MacOS - plugin_path = darwin_path - else: # Linux - plugin_path = linux_path - if not os.path.exists(plugin_path): - return "" - return plugin_path - # end diff --git a/cad/src/ne1_ui/UserPrefs.py b/cad/src/ne1_ui/UserPrefs.py index e503b27a8..878c56f2d 100755 --- a/cad/src/ne1_ui/UserPrefs.py +++ b/cad/src/ne1_ui/UserPrefs.py @@ -44,7 +44,7 @@ from widgets.prefs_widgets import connect_colorpref_to_colorframe, connect_check from utilities import debug_flags from platform.PlatformDependent import screen_pos_size from platform.PlatformDependent import get_rootdir -from graphics.rendering.povray.povray import get_default_plugin_path +from platform.Paths import get_default_plugin_path from utilities.icon_utilities import geticon from utilities.prefs_constants import displayCompass_prefs_key diff --git a/cad/src/platform/Paths.py b/cad/src/platform/Paths.py new file mode 100644 index 000000000..306186450 --- /dev/null +++ b/cad/src/platform/Paths.py @@ -0,0 +1,28 @@ +# Copyright 2008 Nanorex, Inc. See LICENSE file for details. +""" +Paths.py -- platform dependant filename paths + +@author: Bruce, Mark, maybe others +@version: $Id$ +@copyright: 2008 Nanorex, Inc. See LICENSE file for details. +""" + +import sys +import os + +def get_default_plugin_path(win32_path, darwin_path, linux_path): + """ + Returns the plugin (executable) path to the standard location for each platform + (taken from the appropriate one of the three platform-specific arguments), + but only if a file or dir exists there. + Otherwise, returns an empty string. + """ + if sys.platform == "win32": # Windows + plugin_path = win32_path + elif sys.platform == "darwin": # MacOS + plugin_path = darwin_path + else: # Linux + plugin_path = linux_path + if not os.path.exists(plugin_path): + return "" + return plugin_path |