def getReplaceableExportGcode(nameOfReplaceFile, replaceableExportGcode):
 replaceLines = settings.getAlterationLines(nameOfReplaceFile)
 if (len(replaceLines) < 1):
  return replaceableExportGcode
 for replaceLine in replaceLines:
  splitLine = replaceLine.replace('\\n', ' DCTB ').split(' DCTB ')
  if (len(splitLine) > 0):
   replaceableExportGcode = replaceableExportGcode.replace(splitLine[0], '\n'.join(splitLine[1:]))
 output = cStringIO.StringIO()
 gcodec.addLinesToCString(output, archive.getTextLines(replaceableExportGcode))
 return output.getvalue()

def getReplaceableExportGcode ( nameOfReplaceFile , replaceableExportGcode ) : replaceLines = settings . getAlterationLines ( nameOfReplaceFile ) if ( len ( replaceLines ) < 1 ) : return replaceableExportGcode for replaceLine in replaceLines : splitLine = replaceLine . replace ( '\\n' , ' DCTB ' ) . split ( ' DCTB ' ) if ( len ( splitLine ) > 0 ) : replaceableExportGcode = replaceableExportGcode . replace ( splitLine [ 0 ] , '\n' . join ( splitLine [ 1 : ] ) ) output = cStringIO . StringIO ( ) gcodec . addLinesToCString ( output , archive . getTextLines ( replaceableExportGcode ) ) return output . getvalue ( )
get text with strings replaced according to replace .