[Bf-blender-cvs] [096602d3a8] master: bpy.path.display_name: strip spaces
Campbell Barton
noreply at git.blender.org
Thu Mar 23 21:02:29 CET 2017
Commit: 096602d3a86b013771fcbc0268ef2c554a694636
Author: Campbell Barton
Date: Fri Mar 24 06:48:24 2017 +1100
Branches: master
https://developer.blender.org/rB096602d3a86b013771fcbc0268ef2c554a694636
bpy.path.display_name: strip spaces
Useful for Python module paths that can't start with numbers.
===================================================================
M release/scripts/modules/bpy/path.py
===================================================================
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py
index a864a86eba..e17d710068 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()
More information about the Bf-blender-cvs
mailing list