[Bf-blender-cvs] [6cc5c28d15f] master: Fix UI extension removal
Campbell Barton
noreply at git.blender.org
Fri Jan 25 03:48:33 CET 2019
Commit: 6cc5c28d15f45aee5c15d2560d9743d824d99ad3
Author: Campbell Barton
Date: Fri Jan 25 13:45:56 2019 +1100
Branches: master
https://developer.blender.org/rB6cc5c28d15f45aee5c15d2560d9743d824d99ad3
Fix UI extension removal
App-templates & keymap names had their extensions removed twice.
Confusing for filenames containing dots.
===================================================================
M release/scripts/modules/bpy/path.py
M release/scripts/modules/rna_keymap_ui.py
M release/scripts/startup/bl_ui/space_topbar.py
===================================================================
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py
index d236af87052..845475b9180 100644
--- a/release/scripts/modules/bpy/path.py
+++ b/release/scripts/modules/bpy/path.py
@@ -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,
@@ -209,7 +209,8 @@ def display_name(name):
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():
diff --git a/release/scripts/modules/rna_keymap_ui.py b/release/scripts/modules/rna_keymap_ui.py
index 9d6020dc5ea..a6826c1d13c 100644
--- a/release/scripts/modules/rna_keymap_ui.py
+++ b/release/scripts/modules/rna_keymap_ui.py
@@ -369,7 +369,7 @@ def draw_keymaps(context, layout):
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)"
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index d27f8e303c9..937cec9eb29 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -588,7 +588,7 @@ class TOPBAR_MT_file(Menu):
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",
More information about the Bf-blender-cvs
mailing list