Example #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
Example #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
Example #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
Example #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
Example #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
Example #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
Example #7
0
def _curses_tigetstr(capname):
    # NOT_RPYTHON
    try:
        res = _curses.tigetstr(capname)
    except _curses.error, e:
        raise curses_error(e.args[0])
Example #8
0
def _curses_tigetstr(capname):
    # NOT_RPYTHON
    try:
        res = _curses.tigetstr(capname)
    except _curses.error, e:
        raise curses_error(e.args[0])