normalize layer name: convert points to underscore
parent
3a014e077e
commit
04d6349d1c
|
@ -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
|
||||
|
||||
|
|
4
fn.py
4
fn.py
|
@ -980,7 +980,7 @@ def normalize(text):
|
|||
return text.lower().replace('-', '_')
|
||||
|
||||
PATTERN = r'^(?P<grp>-\s)?(?P<tag>[A-Z]{2}_)?(?P<name>.*?)(?P<sfix>_[A-Z]{2})?(?P<inc>\.\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:
|
||||
|
|
Loading…
Reference in New Issue