def printText(self, y, x, printer, maxLen):
        printedSoFar = 0
        for index, val in enumerate(self.segments):
            if printedSoFar >= maxLen:
                break
            if index % 2 == 1:
                # text
                toPrint = val[0:maxLen - printedSoFar]
                printer.addstr(y, x + printedSoFar, toPrint,
                               ColorPrinter.CURRENT_COLORS)
                printedSoFar += len(toPrint)
            else:
                # formatting
                printer.setAttributes(*self.parseFormatting(val))
Retreive a :class:`~elasticsearch.Connection` instance from the
dataset/ETHPy150Open facebook/PathPicker/src/formattedText.py/FormattedText.printText--crossover with--dataset/ETHPy150Open KunihikoKido/sublime-elasticsearch-client/lib/elasticsearch/transport.py/Transport.get_connection