(ch)
| 160 | }) |
| 161 | |
| 162 | def has_key(ch): |
| 163 | if isinstance(ch, str): |
| 164 | ch = ord(ch) |
| 165 | |
| 166 | # Figure out the correct capability name for the keycode. |
| 167 | capability_name = _capability_names.get(ch) |
| 168 | if capability_name is None: |
| 169 | return False |
| 170 | |
| 171 | #Check the current terminal description for that capability; |
| 172 | #if present, return true, else return false. |
| 173 | if _curses.tigetstr(capability_name): |
| 174 | return True |
| 175 | else: |
| 176 | return False |
| 177 | |
| 178 | if __name__ == '__main__': |
| 179 | # Compare the output of this implementation and the ncurses has_key, |
no test coverage detected
searching dependent graphs…