diff --git a/CHANGELOG.md b/CHANGELOG.md index 08fe7d4..0663442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Activate / deactivate all masks using MA layers 1.3.3 - fixed: problem evaluating broken modifier target +- added: normalize layer name now convert points to underscore 1.3.2 diff --git a/fn.py b/fn.py index 4278080..e7a42c3 100644 --- a/fn.py +++ b/fn.py @@ -980,7 +980,7 @@ def normalize(text): return text.lower().replace('-', '_') PATTERN = r'^(?P-\s)?(?P[A-Z]{2}_)?(?P.*?)(?P_[A-Z]{2})?(?P\.\d{3})?$' # numering -def normalize_layer_name(layer, prefix='', desc='', suffix='', lower=True, dash_to_underscore=True, get_only=False): +def normalize_layer_name(layer, prefix='', desc='', suffix='', lower=True, dash_to_underscore=True, point_to_underscore=True, get_only=False): '''GET a layer and argument to build and assign name''' import re @@ -1022,6 +1022,8 @@ def normalize_layer_name(layer, prefix='', desc='', suffix='', lower=True, dash_ name = name.lower() if dash_to_underscore: name = name.replace('-', '_') + if point_to_underscore: + name = name.replace('.', '_') new = f'{grp}{tag}{name}{sfix}' # lower suffix ? if get_only: