

def __init__(self, pygsurf=None, prompt='', x=None, y=None, maxlength=None, fgcolor=None, bgcolor=None, promptfgcolor=None, promptbgcolor=None, whitelistchars=None, blacklistchars=None, parent=None):
    self.buffer = []
    self.prompt = prompt
    self.pygsurf = pygsurf
    self.parent = parent
    if ((maxlength is None) and (pygsurf is None)):
        self._maxlength = 4094
    elif ((maxlength is None) and (x is not None) and (y is not None)):
        self._maxlength = (pygsurf.width - x)
    else:
        self._maxlength = ((((pygsurf is not None) and (maxlength > 0)) and maxlength) or 4094)
    self.cursor = 0
    self.showCursor = True
    self.blinkingCursor = True
    self.eraseBufferSize = None
    self.insertMode = False
    self.done = False
    if (pygsurf is not None):
        if (x is None):
            self.startx = pygsurf.cursorx
        else:
            self.startx = x
        if (y is None):
            self.starty = pygsurf.cursory
        else:
            self.starty = y
        self.lastScrollCount = pygsurf._scrollcount
    else:
        if (x is None):
            self.startx = 0
        else:
            self.startx = x
        if (y is None):
            self.starty = 0
        else:
            self.starty = y
        self.lastScrollCount = 0
    self._fgcolor = (((fgcolor is not None) and getpygamecolor(fgcolor)) or None)
    self._bgcolor = (((bgcolor is not None) and getpygamecolor(bgcolor)) or None)
    self._promptfgcolor = (((promptfgcolor is not None) and getpygamecolor(promptfgcolor)) or None)
    self._promptbgcolor = (((promptbgcolor is not None) and getpygamecolor(promptbgcolor)) or None)
    self.whitelistchars = whitelistchars
    self.blacklistchars = blacklistchars
    self.multiline = True
    self.KEYMAPPING = {
        K_LEFT: self.leftarrow,
        K_RIGHT: self.rightarrow,
        K_HOME: self.home,
        K_END: self.end,
        K_BACKSPACE: self.backspace,
        K_DELETE: self.delete,
        K_INSERT: self.insert,
        K_UP: self.uparrow,
        K_DOWN: self.downarrow,
    }
    if (pygsurf._pygcurseClass == 'PygcurseWindow'):
        self.pygsurface = pygsurf.surface
    elif (pygsurf._pygcurseClass == 'PygcurseSurface'):
        self.pygsurface = pygsurf
    else:
        raise Exception('Invalid argument passed for pygsurf parameter.')
    self.history = parent.input_history
    self.history_index = (- 1)

dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py PygcurseInput.__init__/VarMisuse@157/190 `maxlength`->`pygsurf`