mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-24 15:55:37 +05:00
Préfixe autre qu'un entier
This commit is contained in:
parent
1a2209c281
commit
898796393d
@ -22,7 +22,7 @@
|
|||||||
#import logging
|
#import logging
|
||||||
from .geomsmesh import smesh
|
from .geomsmesh import smesh
|
||||||
|
|
||||||
def putName (objmesh, name, i_suff=-1, i_pref=-1):
|
def putName (objmesh, name, i_suff=-1, i_pref=None):
|
||||||
"""Nommage des objets mesh
|
"""Nommage des objets mesh
|
||||||
|
|
||||||
@objmesh objet à nommer
|
@objmesh objet à nommer
|
||||||
@ -33,13 +33,16 @@ def putName (objmesh, name, i_suff=-1, i_pref=-1):
|
|||||||
|
|
||||||
#logging.info("putName pour %s - i_suff=%d, i_pref=%d", name, i_suff, i_pref)
|
#logging.info("putName pour %s - i_suff=%d, i_pref=%d", name, i_suff, i_pref)
|
||||||
# suffixe éventuel :
|
# suffixe éventuel :
|
||||||
if i_suff >= 0:
|
if ( i_suff >= 0 ):
|
||||||
suffixe = "_{}".format(i_suff)
|
suffixe = "_{}".format(i_suff)
|
||||||
name += suffixe
|
name += suffixe
|
||||||
|
|
||||||
# préfixe éventuel :
|
# préfixe éventuel :
|
||||||
if i_pref >= 0:
|
if ( i_pref is not None):
|
||||||
prefixe = "Cas{:02d}_".format(i_pref)
|
if isinstance(i_pref,int):
|
||||||
|
prefixe = "Cas{:02d}_".format(i_pref)
|
||||||
|
else:
|
||||||
|
prefixe = "{}_".format(i_pref)
|
||||||
name = prefixe + name
|
name = prefixe + name
|
||||||
#logging.info("Au final : %s", name)
|
#logging.info("Au final : %s", name)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user