[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38995] trunk/blender/release/scripts/ startup/bl_ui/space_userpref_keymap.py: Add . py extension if it is missing from keymap file.

Kent Mein mein at cs.umn.edu
Wed Aug 3 19:58:07 CEST 2011


Revision: 38995
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38995
Author:   sirdude
Date:     2011-08-03 17:58:06 +0000 (Wed, 03 Aug 2011)
Log Message:
-----------
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

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_userpref_keymap.py

Modified: trunk/blender/release/scripts/startup/bl_ui/space_userpref_keymap.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_userpref_keymap.py	2011-08-03 17:45:09 UTC (rev 38994)
+++ trunk/blender/release/scripts/startup/bl_ui/space_userpref_keymap.py	2011-08-03 17:58:06 UTC (rev 38995)
@@ -592,6 +592,9 @@
         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")




More information about the Bf-blender-cvs mailing list