def getGcodeWithoutDuplication(duplicateWord, gcodeText):
 lines = archive.getTextLines(gcodeText)
 oldWrittenLine = None
 output = cStringIO.StringIO()
 for line in lines:
  firstWord = getFirstWordFromLine(line)
  if (firstWord == duplicateWord):
   if (line != oldWrittenLine):
    output.write((line + '\n'))
    oldWrittenLine = line
  elif (len(line) > 0):
   output.write((line + '\n'))
 return output.getvalue()

def getGcodeWithoutDuplication ( duplicateWord , gcodeText ) : lines = archive . getTextLines ( gcodeText ) oldWrittenLine = None output = cStringIO . StringIO ( ) for line in lines : firstWord = getFirstWordFromLine ( line ) if ( firstWord == duplicateWord ) : if ( line != oldWrittenLine ) : output . write ( ( line + '\n' ) ) oldWrittenLine = line elif ( len ( line ) > 0 ) : output . write ( ( line + '\n' ) ) return output . getvalue ( )
get gcode text without duplicate first words .