

def paste(self, text):
    "\n        Inserts the string text into the buffer at the position of the cursor. This does not actually use the system's clipboard, it only pastes from the text parameter.\n        "
    text = unicode(text)
    if ((not self.insertMode) and ((len(text) + len(self.buffer)) > self._maxlength)):
        text = text[:(self._maxlength - len(self.buffer))]
    if (self.cursor == len(self.buffer)):
        self.buffer.extend(list(text))
    elif (self.cursor == 0):
        self.buffer = (list(text) + self.buffer)
    elif self.insertMode:
        self.buffer = ((self.buffer[:self.cursor] + list(text)) + self.buffer[(self.cursor + len(text)):])
    else:
        self.buffer = ((text.buffer[:self.cursor] + list(text)) + self.buffer[self.cursor:])

dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py PygcurseInput.paste/VarMisuse@187/268 `self`->`text`