diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-03-23 22:48:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-03-23 22:55:44 +0300 |
commit | 096602d3a86b013771fcbc0268ef2c554a694636 (patch) | |
tree | ac8b9c7ff48dd5e3254d789dac90ec0c46d18576 /release/scripts/modules/bpy/path.py | |
parent | 05b7591c6240a3af1b71420ac3386787f1f384da (diff) |
bpy.path.display_name: strip spaces
Useful for Python module paths that can't start with numbers.
Diffstat (limited to 'release/scripts/modules/bpy/path.py')
-rw-r--r-- | release/scripts/modules/bpy/path.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index a864a86eba7..e17d710068c 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -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() |