fix [#27143] Cannot import key configuration with systemwide install
authorCampbell Barton <ideasman42@gmail.com>
Tue, 3 May 2011 08:21:11 +0000 (08:21 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 3 May 2011 08:21:11 +0000 (08:21 +0000)
release/scripts/startup/bl_ui/space_userpref_keymap.py

index 2fbaae499e7ccfea5f8dded7b22cbc8a21fc35f0..378fe2310915ce1455045d250c89d726f3987f00 100644 (file)
@@ -555,13 +555,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
 
         config_name = basename(self.filepath)
 
-        path = bpy.utils.preset_paths("keyconfig")[0]  # we need some way to tell the user and system preset path
-        print(path)
-
-        # create config folder if needed
-        if not os.path.exists(path):
-            os.mkdir(path)
-
+        path = bpy.utils.user_resource('SCRIPTS', os.path.join("presets", "keyconfig"), create=True)
         path = os.path.join(path, config_name)
 
         if self.keep_original: