def getSettingString(lines, procedureName, settingNameStart):
 settingNameStart = settingNameStart.replace(' ', '_')
 for line in lines:
  splitLine = gcodec.getSplitLineBeforeBracketSemicolon(line)
  firstWord = None
  if (len(splitLine) > 0):
   firstWord = splitLine[0]
  if (firstWord == '(<setting>'):
   if (len(splitLine) > 4):
    if ((splitLine[1] == procedureName) and splitLine[2].startswith(settingNameStart)):
     return splitLine[3]
  elif (firstWord == '(</settings>)'):
   return None
 return None

def getSettingString ( lines , procedureName , settingNameStart ) : settingNameStart = settingNameStart . replace ( ' ' , '_' ) for line in lines : splitLine = gcodec . getSplitLineBeforeBracketSemicolon ( line ) firstWord = None if ( len ( splitLine ) > 0 ) : firstWord = splitLine [ 0 ] if ( firstWord == '(<setting>' ) : if ( len ( splitLine ) > 4 ) : if ( ( splitLine [ 1 ] == procedureName ) and splitLine [ 2 ] . startswith ( settingNameStart ) ) : return splitLine [ 3 ] elif ( firstWord == '(</settings>)' ) : return None return None
get the setting value from the lines .