pyrepl/pyrepl unix_console.py,1.4,1.5
[email protected] Fri, 17 Jan 2003 15:07:31 +0100 (MET)
| Newsgroups | gmane.comp.python.pyrepl.checkins |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvs/pyrepl/pyrepl/pyrepl
In directory thoth.codespeak.net:/tmp/cvs-serv2946
Modified Files:
unix_console.py
Log Message:
Bah. Fix mis-merge.
Index: unix_console.py
===================================================================
RCS file: /cvs/pyrepl/pyrepl/pyrepl/unix_console.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** unix_console.py 17 Jan 2003 13:35:21 -0000 1.4
--- unix_console.py 17 Jan 2003 14:07:29 -0000 1.5
***************
*** 65,73 ****
_keysets = {}
! def keyset(term=None):
! if term is None:
! term = os.environ["TERM"]
try:
! return _keysets[term]
except KeyError:
set = {'space' : ' ', 'tab' : '\t', 'hash' : '#',
--- 65,75 ----
_keysets = {}
! def keyset(con=None):
! if con is None:
! term, fd = os.environ["TERM"], 0
! else:
! term, fd = con.term, con.fd
try:
! return _keysets[(term, fd)]
except KeyError:
set = {'space' : ' ', 'tab' : '\t', 'hash' : '#',
***************
*** 76,80 ****
set[key] = curses.tigetstr(code)
set["backspace"] = termios.tcgetattr(fd)[6][termios.VERASE]
! return _keysets.setdefault(term, set)
# at this point, can we say: AAAAAAAAAAAAAAAAAAAAAARGH!
--- 78,82 ----
set[key] = curses.tigetstr(code)
set["backspace"] = termios.tcgetattr(fd)[6][termios.VERASE]
! return _keysets.setdefault((term, fd), set)
# at this point, can we say: AAAAAAAAAAAAAAAAAAAAAARGH!
***************
*** 179,186 ****
def install_keymap(self, new_keymap):
self.k = self.keymap = \
! unix_keymap.compile_keymap(new_keymap, keyset(self.term))
def describe_event(self, event):
! return unix_keymap.unparse_keyf(event.chars, keyset(self.term))
def refresh(self, screen, (cx, cy)):
--- 181,188 ----
def install_keymap(self, new_keymap):
self.k = self.keymap = \
! unix_keymap.compile_keymap(new_keymap, keyset(self))
def describe_event(self, event):
! return unix_keymap.unparse_keyf(event.chars, keyset(self))
def refresh(self, screen, (cx, cy)):