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