

def paste(self, srcregion=None, dstsurf=None, dstregion=None, pastechars=True, pastefgcolor=True, pastebgcolor=True, pasteredtint=True, pastegreentint=True, pastebluetint=True):
    (srcx, srcy, srcwidth, srcheight) = self.getregion(srcregion)
    if ((srcx, srcy, srcwidth, srcheight) == (None, None, None, None)):
        return
    if (dstsurf is None):
        dstsurf = PygcurseSurface(srcwidth, srcheight, font=self._font, fgcolor=self._fgcolor, bgcolor=self._bgcolor)
    elif (dstsurf._pygcurseClass not in ('PygcurseSurface', 'PygcurseWindow')):
        return
    (dstx, dsty, dstwidth, dstheight) = dstsurf.getregion(dstregion)
    if ((dstx, dsty, dstwidth, dstheight) == (None, None, None, None)):
        return
    if ((self == dstsurf) and regionsoverlap((srcx, srcy, srcwidth, srcheight), (dstx, dsty, dstwidth, dstheight))):
        tempsurf = self.paste((srcx, srcy, srcwidth, srcheight))
        tempsurf.paste(None, self, (dstx, dsty, dstwidth, dstheight))
        return
    for ix in range(srcx, (srcx + srcwidth)):
        for iy in range(srcy, (srcy + srcheight)):
            finx = (dstx + (ix - srcx))
            finy = (dsty + (iy - srcy))
            if ((not dstsurf.isonscreen(finx, finy)) or ((ix - srcx) >= dstwidth) or ((iy - srcy) >= dstheight)):
                continue
            if (pastechars and (self._screenchar[ix][iy] is not None)):
                dstsurf._screenchar[finx][finy] = self._screenchar[ix][iy]
            if (pastefgcolor and (self._screenfgcolor[ix][iy] is not None)):
                dstsurf._screenfgcolor[finx][finy] = self._screenfgcolor[ix][iy]
            if (pastebgcolor and (self._screenbgcolor[ix][iy] is not None)):
                dstsurf._screenbgcolor[finx][finy] = self._screenbgcolor[ix][iy]
            if (pasteredtint and (self._screenRdelta[ix][iy] is not None)):
                dstsurf._screenRdelta[finx][finy] = self._screenRdelta[ix][iy]
            if (pastegreentint and (self._screenGdelta[ix][iy] is not None)):
                dstsurf._screenGdelta[finx][finy] = self._screenGdelta[ix][iy]
            if (pastebluetint and (self._screenBdelta[ix][iy] is not None)):
                dstsurf._screenBdelta[finx][finy] = self._screenBdelta[ix][iy]
            dstsurf._screendirty[finx][finy] = True
    if dstsurf._autoupdate:
        dstsurf.update()

dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py PygcurseSurface.paste/original