bpy.path.display_name: strip spaces

Useful for Python module paths that can't start with numbers.
This commit is contained in:
Campbell Barton 2017-03-24 06:48:24 +11:00
parent 05b7591c62
commit 096602d3a8
1 changed files with 3 additions and 1 deletions

View File

@ -204,7 +204,9 @@ def display_name(name):
name = name.replace("_colon_", ":")
name = name.replace("_plus_", "+")
name = name.replace("_", " ")
# strip to allow underscore prefix
# (when paths can't start with numbers for eg).
name = name.replace("_", " ").lstrip(" ")
if name.islower():
name = name.lower().title()