[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1292] trunk/py/scripts/addons/modules/ extensions_framework: extensions_framework: Updates for changes to user_resource API

Doug Hammond doughammond at hamsterfight.co.uk
Sat Dec 18 15:11:08 CET 2010


Revision: 1292
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=1292
Author:   dougal2
Date:     2010-12-18 15:11:07 +0100 (Sat, 18 Dec 2010)

Log Message:
-----------
extensions_framework: Updates for changes to user_resource API

Modified Paths:
--------------
    trunk/py/scripts/addons/modules/extensions_framework/__init__.py
    trunk/py/scripts/addons/modules/extensions_framework/util.py

Modified: trunk/py/scripts/addons/modules/extensions_framework/__init__.py
===================================================================
--- trunk/py/scripts/addons/modules/extensions_framework/__init__.py	2010-12-18 12:43:38 UTC (rev 1291)
+++ trunk/py/scripts/addons/modules/extensions_framework/__init__.py	2010-12-18 14:11:07 UTC (rev 1292)
@@ -29,11 +29,9 @@
 import bpy
 
 from extensions_framework.ui import EF_OT_msg
-
 bpy.types.register(EF_OT_msg)
 del EF_OT_msg
 
-
 def log(str, popup=False, module_name='EF'):
 	"""Print a message to the console, prefixed with the module_name
 	and the current time. If the popup flag is True, the message will

Modified: trunk/py/scripts/addons/modules/extensions_framework/util.py
===================================================================
--- trunk/py/scripts/addons/modules/extensions_framework/util.py	2010-12-18 12:43:38 UTC (rev 1291)
+++ trunk/py/scripts/addons/modules/extensions_framework/util.py	2010-12-18 14:11:07 UTC (rev 1292)
@@ -35,10 +35,12 @@
 
 """List of possibly appropriate paths to load/save addon config from/to"""
 config_paths = []
-if bpy.utils.user_resource('CONFIG') != "": config_paths.append(bpy.utils.user_resource('CONFIG'))
-if bpy.utils.user_resource('SCRIPTS') != "": config_paths.append(bpy.utils.user_resource('SCRIPTS'))
-for pth in bpy.utils.script_paths():
-	if pth != "": config_paths.append(pth)
+if bpy.utils.user_resource('CONFIG', '') != "": config_paths.append(bpy.utils.user_resource('CONFIG', '', create=True))
+if bpy.utils.user_resource('SCRIPTS', '') != "": config_paths.append(bpy.utils.user_resource('SCRIPTS', '', create=True))
+# want to scan other script paths in reverse order, since the user path comes last
+sp = [p for p in bpy.utils.script_paths() if p != '']
+sp.reverse()
+config_paths.extend(sp)
 
 """This path is set at the start of export, so that calls to
 path_relative_to_export() can make all exported paths relative to




More information about the Bf-extensions-cvs mailing list