[Bf-blender-cvs] [20d06eb3a85] master: WM: avoid string replace w/ appconfig-activate

Campbell Barton noreply at git.blender.org
Mon Nov 12 21:02:44 CET 2018


Commit: 20d06eb3a85bc2930aef9a9d882d66905fb1fecf
Author: Campbell Barton
Date:   Tue Nov 13 06:59:23 2018 +1100
Branches: master
https://developer.blender.org/rB20d06eb3a85bc2930aef9a9d882d66905fb1fecf

WM: avoid string replace w/ appconfig-activate

Better construct an exact path, this would fail if the path exists
multiple times in the string.

===================================================================

M	release/scripts/startup/bl_operators/wm.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 381e98c2940..53735ed3ece 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1417,10 +1417,10 @@ class WM_OT_appconfig_activate(Operator):
 
     def execute(self, context):
         import os
-        bpy.utils.keyconfig_set(self.filepath)
-
-        filepath = self.filepath.replace("keyconfig", "interaction")
-
+        filepath = self.filepath
+        bpy.utils.keyconfig_set(filepath)
+        dirname, filename = os.path.split(filepath)
+        filepath = os.path.normpath(os.path.join(dirname, os.pardir, "interaction", filename))
         if os.path.exists(filepath):
             bpy.ops.script.execute_preset(
                 filepath=filepath,



More information about the Bf-blender-cvs mailing list