Add .py extension if it is missing from keymap file.
authorKent Mein <mein@cs.umn.edu>
Wed, 3 Aug 2011 17:58:06 +0000 (17:58 +0000)
committerKent Mein <mein@cs.umn.edu>
Wed, 3 Aug 2011 17:58:06 +0000 (17:58 +0000)
This is for bug #28141
While not really a bug, it makes it a lot easyer to use if it
has the exension.  (Isn't hidden from the user when they try to load it...)

Kent

release/scripts/startup/bl_ui/space_userpref_keymap.py

index 8fed3a934d9b92109992bfb6fbf0686e01a268f0..585c3cffcb9bf99027486c7a6b1212ea730054a3 100644 (file)
@@ -592,6 +592,9 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
         if not self.filepath:
             raise Exception("Filepath not set")
 
+        if not self.filepath.endswith('.py'):
+            self.filepath += '.py'
+
         f = open(self.filepath, "w")
         if not f:
             raise Exception("Could not open file")