Skip to content
Permalink
Browse files

[ftools] Further SIP API updates

  • Loading branch information
m-kuhn committed Jun 15, 2013
1 parent 36e1b3b commit d256fd8c3a8bf5efc8b72a3455d9ec00b9376538
Showing with 7 additions and 7 deletions.
  1. +7 −7 python/plugins/fTools/tools/ftools_utils.py
@@ -165,17 +165,17 @@ def testForUniqueness( fieldList1, fieldList2 ):

# Create a unique field name based on input field name
def createUniqueFieldName( field ):
check = field.name().right( 2 )
shortName = field.name().left( 8 )
if check.startsWith("_"):
( val, test ) = check.right( 1 ).toInt()
if test:
check = field.name()[-2:]
shortName = field.name()[:8]
if check[0] == "_":
try:
val = int( check[-1:] )
if val < 2:
val = 2
else:
val = val + 1
field.setName( shortName.left( len( shortName )-1 ) + unicode( val ) )
else:
field.setName( shortName[len( shortName )-1:] + unicode( val ) )
except exceptions.ValueError:
field.setName( shortName + "_2" )
else:
field.setName( shortName + "_2" )

0 comments on commit d256fd8

Please sign in to comment.
You can’t perform that action at this time.