Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/modules/bpy/path.py')
-rw-r--r--release/scripts/modules/bpy/path.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py
index 3860445233d..fad52eae84a 100644
--- a/release/scripts/modules/bpy/path.py
+++ b/release/scripts/modules/bpy/path.py
@@ -201,12 +201,13 @@ _display_name_literals = {
}
-def display_name(name, *, has_ext=True):
+def display_name(name, *, has_ext=True, title_case=True):
"""
Creates a display string from name to be used menus and the user interface.
- Capitalize the first letter in all lowercase names,
- mixed case names are kept as is. Intended for use with
- filenames and module names.
+ Intended for use with filenames and module names.
+
+ :arg has_ext: Remove file extension from name
+ :arg title_case: Convert lowercase names to title case
"""
if has_ext:
@@ -220,7 +221,7 @@ def display_name(name, *, has_ext=True):
# (when paths can't start with numbers for eg).
name = name.replace("_", " ").lstrip(" ")
- if name.islower():
+ if title_case and name.islower():
name = name.lower().title()
name = _clean_utf8(name)