Skip to content

Commit

Permalink
[ftools] Further SIP API updates
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 15, 2013
1 parent 36e1b3b commit d256fd8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions python/plugins/fTools/tools/ftools_utils.py
Expand Up @@ -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" )
Expand Down

0 comments on commit d256fd8

Please sign in to comment.