diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-11 17:08:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-11 17:08:22 +0300 |
commit | 8f4c340915fbfc65f9380b9a8561ed877c7dab87 (patch) | |
tree | faff718fe726b2a4cb3dee1cd93e58e0ba4a94e0 /release | |
parent | a2b94de5397f3a259c4244379b7fa89e57769d82 (diff) |
bpy.utils.home_paths, use this to get script paths for the user/local/system blender paths.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bpy/utils.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index 7f10be362df..3f7a38f87c9 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -27,6 +27,7 @@ import bpy as _bpy import os as _os import sys as _sys +from _bpy import home_paths def load_scripts(reload_scripts=False, refresh_scripts=False): import traceback @@ -171,17 +172,15 @@ def script_paths(*args): # add user scripts dir user_script_path = _bpy.context.user_preferences.filepaths.python_scripts_directory - - if not user_script_path: - # XXX - WIN32 needs checking, perhaps better call a blender internal function. - user_script_path = _os.path.join(_os.path.expanduser("~"), ".blender", "scripts") - - user_script_path = _os.path.normpath(user_script_path) - - if user_script_path not in scripts and _os.path.isdir(user_script_path): - scripts.append(user_script_path) + + for path in home_paths("scripts") + (user_script_path, ): + if path: + path = _os.path.normpath(path) + if path not in scripts and _os.path.isdir(path): + scripts.append(path) if not args: + print(scripts) return scripts subdir = _os.path.join(*args) @@ -190,7 +189,7 @@ def script_paths(*args): path_subdir = _os.path.join(path, subdir) if _os.path.isdir(path_subdir): script_paths.append(path_subdir) - + print(script_paths) return script_paths |