Fix UI extension removal
authorCampbell Barton <ideasman42@gmail.com>
Fri, 25 Jan 2019 02:45:56 +0000 (13:45 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 25 Jan 2019 02:49:59 +0000 (13:49 +1100)
App-templates & keymap names had their extensions removed twice.

Confusing for filenames containing dots.

release/scripts/modules/bpy/path.py
release/scripts/modules/rna_keymap_ui.py
release/scripts/startup/bl_ui/space_topbar.py

index d236af870527ff45384511e3bbd47d2c4605523d..845475b9180a48132e1eeed6fdc625ec8db62688 100644 (file)
@@ -201,7 +201,7 @@ _display_name_literals = {
 }
 
 
 }
 
 
-def display_name(name):
+def display_name(name, *, has_ext=True):
     """
     Creates a display string from name to be used menus and the user interface.
     Capitalize the first letter in all lowercase names,
     """
     Creates a display string from name to be used menus and the user interface.
     Capitalize the first letter in all lowercase names,
@@ -209,7 +209,8 @@ def display_name(name):
     filenames and module names.
     """
 
     filenames and module names.
     """
 
-    name = _os.path.splitext(basename(name))[0]
+    if has_ext:
+        name = _os.path.splitext(basename(name))[0]
 
     # string replacements
     for disp_value, file_value in _display_name_literals.items():
 
     # string replacements
     for disp_value, file_value in _display_name_literals.items():
index 9d6020dc5ea3af054db5462529db9f50a77f1ef9..a6826c1d13c932bfe74cae345fd75d93013dc0f2 100644 (file)
@@ -369,7 +369,7 @@ def draw_keymaps(context, layout):
     spref = context.space_data
 
     # row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config")
     spref = context.space_data
 
     # row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config")
-    text = bpy.path.display_name(kc_active.name)
+    text = bpy.path.display_name(kc_active.name, has_ext=False)
     if not text:
         text = "Blender (default)"
 
     if not text:
         text = "Blender (default)"
 
index d27f8e303c9743ff8189cc98e92d78c8faf4dc92..937cec9eb29aa7fb24daef290771d14c3faa24f8 100644 (file)
@@ -588,7 +588,7 @@ class TOPBAR_MT_file(Menu):
             app_template = None
 
         if app_template:
             app_template = None
 
         if app_template:
-            layout.label(text=bpy.path.display_name(app_template))
+            layout.label(text=bpy.path.display_name(app_template, has_ext=False))
             layout.operator("wm.save_homefile")
             layout.operator(
                 "wm.read_factory_settings",
             layout.operator("wm.save_homefile")
             layout.operator(
                 "wm.read_factory_settings",