diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2016-08-09 17:37:15 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2016-08-09 17:37:15 +0300 |
commit | 4a801f6c6f0421ffd515c12422dd197441440520 (patch) | |
tree | 5415e844b460bb2aa07b9467c72e13abc2e61228 /release/scripts/modules/bpy/path.py | |
parent | 49c63d46db8c055152d9e431e89405f9b51a4bbe (diff) | |
parent | 02719521d2e25abcc8ffcccc086d3a651986f52f (diff) |
Merge branch 'master' into object_nodesobject_nodes
Diffstat (limited to 'release/scripts/modules/bpy/path.py')
-rw-r--r-- | release/scripts/modules/bpy/path.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index 30f6c8eebed..a864a86eba7 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -39,16 +39,16 @@ __all__ = ( "reduce_dirs", "relpath", "resolve_ncase", - ) +) import bpy as _bpy import os as _os from _bpy_path import ( - extensions_audio, - extensions_movie, - extensions_image, - ) + extensions_audio, + extensions_movie, + extensions_image, +) def _getattr_bytes(var, attr): @@ -71,22 +71,22 @@ def abspath(path, start=None, library=None): if path.startswith(b"//"): if library: start = _os.path.dirname( - abspath(_getattr_bytes(library, "filepath"))) + abspath(_getattr_bytes(library, "filepath"))) return _os.path.join( - _os.path.dirname(_getattr_bytes(_bpy.data, "filepath")) - if start is None else start, - path[2:], - ) + _os.path.dirname(_getattr_bytes(_bpy.data, "filepath")) + if start is None else start, + path[2:], + ) else: if path.startswith("//"): if library: start = _os.path.dirname( - abspath(library.filepath)) + abspath(library.filepath)) return _os.path.join( - _os.path.dirname(_bpy.data.filepath) - if start is None else start, - path[2:], - ) + _os.path.dirname(_bpy.data.filepath) + if start is None else start, + path[2:], + ) return path @@ -175,7 +175,7 @@ def clean_name(name, replace="_"): 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, - ) + ) trans = str.maketrans({char: replace for char in bad_chars}) trans_cache[replace] = trans return trans |