Ejemplo n.º 1
0
def has_key(ch):
    if type(ch) == type(''): ch = ord(ch)

    # Figure out the correct capability name for the keycode.
    capability_name = _capability_names[ch]

    #Check the current terminal description for that capability;
    #if present, return true, else return false.
    if _curses.tigetstr(capability_name): return 1
    else: return 0
Ejemplo n.º 2
0
def has_key(ch):
    if type(ch) == type( '' ): ch = ord(ch)

    # Figure out the correct capability name for the keycode.
    capability_name = _capability_names[ch]

    #Check the current terminal description for that capability;
    #if present, return true, else return false.
    if _curses.tigetstr( capability_name ): return 1
    else: return 0
Ejemplo n.º 3
0
def has_key(ch):
    if isinstance(ch, str):
        ch = ord(ch)
    capability_name = _capability_names.get(ch)
    if capability_name is None:
        return False
    elif _curses.tigetstr(capability_name):
        return True
    else:
        return False
        return
Ejemplo n.º 4
0
def has_key(ch):
    if isinstance(ch, str):
        ch = ord(ch)
    capability_name = _capability_names.get(ch)
    if capability_name is None:
        return False
    else:
        if _curses.tigetstr(capability_name):
            return True
        return False
        return
Ejemplo n.º 5
0
def has_key(ch):
    if isinstance(ch, str):
        ch = ord(ch)

    # Figure out the correct capability name for the keycode.
    capability_name = _capability_names.get(ch)
    if capability_name is None:
        return False

    #Check the current terminal description for that capability;
    #if present, return true, else return false.
    if _curses.tigetstr( capability_name ):
        return True
    else:
        return False
Ejemplo n.º 6
0
def has_key(ch):
    if isinstance(ch, str):
        ch = ord(ch)

    # Figure out the correct capability name for the keycode.
    capability_name = _capability_names.get(ch)
    if capability_name is None:
        return False

    #Check the current terminal description for that capability;
    #if present, return true, else return false.
    if _curses.tigetstr(capability_name):
        return True
    else:
        return False
Ejemplo n.º 7
0
def _curses_tigetstr(capname):
    # NOT_RPYTHON
    try:
        res = _curses.tigetstr(capname)
    except _curses.error, e:
        raise curses_error(e.args[0])
Ejemplo n.º 8
0
def _curses_tigetstr(capname):
    # NOT_RPYTHON
    try:
        res = _curses.tigetstr(capname)
    except _curses.error, e:
        raise curses_error(e.args[0])