def setIntegerValueToString(integerSetting, valueString):
 dotIndex = valueString.find('.')
 if (dotIndex > (-1)):
  valueString = valueString[:dotIndex]
 try:
  integerSetting.value = int(valueString)
  return
 except:
  print ((('Warning, can not read integer ' + integerSetting.name) + ' ') + valueString)
  print 'Will try reading as a boolean, which might be a mistake.'
 integerSetting.value = 0
 if (valueString.lower() == 'true'):
  integerSetting.value = 1

def setIntegerValueToString ( integerSetting , valueString ) : dotIndex = valueString . find ( '.' ) if ( dotIndex > ( - 1 ) ) : valueString = valueString [ : dotIndex ] try : integerSetting . value = int ( valueString ) return except : print ( ( ( 'Warning, can not read integer ' + integerSetting . name ) + ' ' ) + valueString ) print 'Will try reading as a boolean, which might be a mistake.' integerSetting . value = 0 if ( valueString . lower ( ) == 'true' ) : integerSetting . value = 1
set the integer to the string .