From 79c87852d2a2b07ba3cb411e00fd0fb4aaee008a Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Wed, 3 Aug 2011 17:58:06 +0000 Subject: Add .py extension if it is missing from keymap file. 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 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py index 8fed3a934d9..585c3cffcb9 100644 --- a/release/scripts/startup/bl_ui/space_userpref_keymap.py +++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py @@ -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") -- cgit v1.2.3