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
|
1.3.3
|
||||||
|
|
||||||
- fixed: problem evaluating broken modifier target
|
- fixed: problem evaluating broken modifier target
|
||||||
|
- added: normalize layer name now convert points to underscore
|
||||||
|
|
||||||
1.3.2
|
1.3.2
|
||||||
|
|
||||||
|
|
4
fn.py
4
fn.py
|
@ -980,7 +980,7 @@ def normalize(text):
|
||||||
return text.lower().replace('-', '_')
|
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
|
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'''
|
'''GET a layer and argument to build and assign name'''
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -1022,6 +1022,8 @@ def normalize_layer_name(layer, prefix='', desc='', suffix='', lower=True, dash_
|
||||||
name = name.lower()
|
name = name.lower()
|
||||||
if dash_to_underscore:
|
if dash_to_underscore:
|
||||||
name = name.replace('-', '_')
|
name = name.replace('-', '_')
|
||||||
|
if point_to_underscore:
|
||||||
|
name = name.replace('.', '_')
|
||||||
|
|
||||||
new = f'{grp}{tag}{name}{sfix}' # lower suffix ?
|
new = f'{grp}{tag}{name}{sfix}' # lower suffix ?
|
||||||
if get_only:
|
if get_only:
|
||||||
|
|
Loading…
Reference in New Issue