

def getdisplayedtext(self):
    margintop = self.margintop
    marginbottom = self.marginbottom
    marginright = self.marginright
    marginleft = self.marginleft
    if (self.border is not None):
        margintop += 1
        marginbottom += 1
        marginleft += 1
        marginright += 1
    elif self.caption:
        margintop += 1
    width = ((self.width - marginleft) - marginright)
    height = ((self.height - margintop) - marginbottom)
    if ((width < 1) or (height < 1)):
        return ''
    if self.wrap:
        text = textwrap.wrap(self.text, width=width)
    else:
        text = spitintogroupsof(width, self.text)
    return text[:height]

dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py PygcurseTextbox.getdisplayedtext/original